D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] apache mod_rewrite

 

On 15 Nov 2013, at 10:24, stinga <stinga+dcglug@xxxxxxxxxxxxx> wrote:

> 
> RewriteRule ^/dir1/.*/.*/(.*)/page.html /$1 [R=301] 
> 

> I am stumped... (it is bound to be something really simple) 
> 

I'm thinking you want groups of charatcters which are "not /"  rather than  ".*" so 
more like:


RewriteRule ^/store/([^/]*)/([^/]*)$    /store.php?id=$1

As regular expressions are greedy.

Haven't checked it, but it fits the symptoms fairly well.
-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq