Page 1 of 1

mod_rewrite help

Posted: Sat Oct 11, 2008 6:14 am
by malcolmboston
Im currently having some serious problems with mod_rewrite or maybe im just not understanding it right.....

Code: Select all

 
Rewriterule '^mens/item/(.*)/(.*)/(.*)/(.*) mens-item-(.*)-(.*)-(.*)-(.*).html [R=301, NC, L]
 
Ive added this line to my mod_rewrite file but i get an internal server error when its turned on.

basically i want this page:
http://www.redsquareclothing.co.uk/mens ... jma-Jacket
to automatically redirect using a 301 to this page:
http://www.redsquareclothing.co.uk/mens ... acket.html

Any help or nod in the right direction would be much appreciated.

edit: :? @ shortened URL

Regards, Mal

Re: mod_rewrite help

Posted: Thu Oct 16, 2008 5:56 am
by j4IzbInao

Code: Select all

Rewriterule ^mens/item/(.*)/(.*)/(.*)/(.*)$ mens-item-($1)-($2)-($3)-($4).html [R=301, NC, L]
Should do the trick.

Re: mod_rewrite help

Posted: Thu Oct 16, 2008 9:59 am
by pickle
j4IzbInao wrote:

Code: Select all

Rewriterule ^mens/item/(.*)/(.*)/(.*)/(.*)$ mens-item-($1)-($2)-($3)-($4).html [R=301, NC, L]
Should do the trick.
Close, but that'll put parentheses in the forwarded URL.

Code: Select all

Rewriterule ^mens/item/(.*)/(.*)/(.*)/(.*)$ mens-item-$1-$2-$3-$4.html [R=301, NC, L]
should do it.