mod_rewrite to convert old url to new url

Associate
Joined
21 May 2003
Posts
1,365
I'm soon to replace an old web application with my new shiney version, but I need to make sure any old urls that are floating around the net go to the equivalent page on the new website.

I want to do this with mod_rewrite -
old url = www.mydomain.co.uk/order/step1.php?id=12345678
new url = www.mydomain.co.uk/event/selectTickets/eventId/12345678

current attempt at re-write rule:
Code:
RewriteRule ^order/step1.php(.)id\=([0-9]+)$ /event/selectTickets/eventId/$1 [R=301,L]

but it's not working, any mod_rewrite gurus?
 
try this:

Code:
RewriteRule ^order/step1.php(.)id\=([0-9]+)$ /event/selectTickets/eventId/$2 [R=301,L]

Because would the (.) not capture in to backreference 1?
 
Last edited:
Back
Top Bottom