Forum Moderators: phranque
I've tried simple rewrite statements, RewriteCond %{REQUEST_URI} statements and RewriteCond %{THE_REQUEST} statements in various incarnations and can't seem to get any of them to work. The closest I've gotten is with this:
RewriteCond %{REQUEST_URI} /blue-widget/
RewriteRule ^(.*)$ http://www.example.com/purple-widget/$1 [R=301,L]
The result of the above is that /blue-widget/ gets appended to the end of the URL, so this:
http://www.example.com/blue-widget/
becomes this:
http://www.example.com/purple-widget/blue-widget/
And this:
http://www.example.com/blue-widget/page.php
becomes this:
http://www.example.com/purple-widget/blue-widget/page.php
I feel like I'm getting really close to a solution. Any help?
RewriteRule ^blue-wdget/(.*)$ http://www.example.com/purple-widget/$1 [R=301,L]
Or you can put this code into the .htaccess file in the /blue-widget subdirectory:
RewriteRule ^(.*)$ http://www.example.com/purple-widget/$1 [R=301,L]
Jim