Forum Moderators: phranque

Message Too Old, No Replies

301 redirect not working :-(

         

liltbrockie

8:30 am on Mar 9, 2010 (gmt 0)

10+ Year Member



Sure this is a very simple problem for you experts to sort out but I am trying to do a simple redirect and its not working... My .htaccess file is in the root folder, I think the problem may be the &252d chars ?


Redirect 301 "/shopping/products/Baumatic-%252d-60-cm-Dishwasher-Fully-%252d-BDI631.html" www.kitchenappliancesforum.co.uk/shopping/products/Baumatic-60-cm-Dishwasher-Fully-BDI631.html



(note: there is "http://" before the new redirect url but i couldnt work out how to compose the message without the forum trying to make it into a link lol

g1smd

9:15 am on Mar 9, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Use example.com to stop the forum linkifying URLs.

Do any of your rules use RewriteRule?

If they do, do not use Redirect in the same .htaccess file. Use Rewrite Rule with [R=301,L] for this rule too.

Beware that RewriteRule cannot see the leading / of the URL request.

You'll need to escape the % and any . in the pattern for the URL request.

liltbrockie

9:59 am on Mar 9, 2010 (gmt 0)

10+ Year Member



Hey thanks for your help... I wonder though.. instead of me doing several hundred lines of redirects.. is there some sort of rule I can apply to do the job for me?

Basically you can see what I'm trying to do ... The rule is
"if user requests /shopping/products/Baumatic-%252d-60-cm-Dishwasher-Fully-%252d-BDI631.html .. redirect them to /shopping/products/Baumatic-60-cm-Dishwasher-Fully-BDI631.html"

jdMorgan

1:33 am on Mar 13, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> Basically you can see what I'm trying to do...

Only partly. I see one URL with two instances of "-%252d-" which we presume you wish to redirect to the same URL with those "-%252d-" instances each replaced by a single hyphen.

What is not clear is whether there are other query strings attached to this same URL, different URLs with the same query string attached, or different URLs with different query strings attached, and whether in any or all of these cases, the number of occurrences of "-%252d-" is always two, and whether they always occur in the same positions or not.

Also not clear is whether you've ever seen this string doubly-encoded as -%25252d- or not.

All of this must be well-described before any code might be proposed, as the solutions are based on pattern-matching, and that pattern must be explicitly defined. Thoroughness and precision in both language and requirements specification is required.

Jim