Hi, I have a URL http://mydomain/accommodations/hotel-details?id=4044&offerId=602 that I want to be rewritten as http://mydomain/accommodations/hotel-details/4044/package/602 However, this rewrite rule is not doing the job. I'm guessing my use of regular expressions is somehow failing and ask the group for advice ... RewriteRule ^/accommodations/hotel-details?id=(.*)&offerId=(.*)$ /accommodations/hotel-details/$1/package/$2 [R=301,L] Thanks, - Dave
Try this, you need to escape ? and .* matches too much: RewriteRule ^/accommodations/hotel-details\?id=(\d+)&offerId=(\d+)$ /accommodations/hotel-details/$1/package/$2 [R=301,L]