.htaccess and RewriteRule

Hi all,

I have a number of pages that have been indexed by Google and appear on the first page of the search, (“DIN Compression Fittings” 4th one down for Cotswold Engineering Supplies), unfortunately my client decided that the folder description should have the word Hydraulic added to distinguish this product line from another. This has resulted in the pages not being found and producing a 404 error.

I have been trying to get the .htaccess file to redirect any calls to the original folder redirected to the new name for the folder.

I need to redirect the folder name from “DIN Compression Fittings” to “DIN Hydraulic Compression Fittings” but not changing anything else in the url.

This is the line I’m using at the moment, but it seems not to work.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^cotswoldengineeringsupplies.co.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www.cotswoldengineeringsupplies.co.uk$
RewriteRule ^DIN Compression Fittings(.*)$ "http://www.cotswoldengineeringsupplies.co.uk/DIN Hydraulic Compression Fittings$1" [R=301,L]

It redirects to the correct (renamed) folder, but the part of the url after the “?” gets reencoded so the % becomes “%25” which means the last bit still has the space url encoded so messes up the link, as here:


which should be:


Click on both to see the results!

How do I fix this?

Thanks in anticipation


freewaytalk mailing list
Update your subscriptions at: