More information about the Underscore mailing list

[_] please can I beg some mod_rewrite help?

Oliver Humpage oliver at watershed.co.uk
Fri Feb 15 12:00:01 GMT 2013

On 15 Feb 2013, at 11:46, Tom Davies wrote:

>> RewriteRule ^shop/([^/]+)/search&(.+)/P([0-9]+)(&?.*) http://%{HTTP_HOST}/shop/$1/P$2/?$1$3 [R,L]
> 
> Thanks Oliver, this wasn't quite there at first pass but with a bit of
> tinkering I ended up with:
> 
>> RewriteRule ^shop/([^/]+)/search&(.+)/P([0-9]+)(&?.*) http://%{HTTP_HOST}/shop/$1/P$3/search?$2 [R=301,L]

Sorry, I put some more capture brackets in and totally forgot to update the backreferences. At least editing it hopefully means you understand it :)

Be *ever* so careful about using 301s: browsers cache them, so you have to be very sure they're what you want to happen forever.

Oliver.