Forum Moderators: phranque
I can't seem to work out how to redirect a all files under a specific folder to my root.
Example:
On my domain I have www.domain.com/subfolder (with a lot of pages in it).
I want users to go to my root everytime they go to .../subfolder/file.html (no matter what file the try to access)
Any suggestions? I know it's easy for some of you, but I have tried for days now.
Could you post an example of what you have tried, so we can not only help you with the rewrite, but also show you where the error may be for future reference?
Please, also post what you mean by not working... do you mean server errors, page not found, or no redirect?
Justin
[edited by: jdMorgan at 1:32 am (utc) on July 14, 2005]
[edit reason] Speling. [/edit]
Among plenty other things I tried:
RewriteEngine On
RewriteRule ^http://www.mydomain.com/blog/(.*)$ [mydomain...] [R=301,L]
The above seems to do absolute nothing.
The above .htaccess is uploaded to the blog folder...thats right is it not?
/ Claus
RewriteRule ^blog/(.*)$ http://www.example.com/$1 [R=301,L]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
Jim
That did not work either.
Also I managed to screw up my allready working "no www" redirect to "www".
That was the most important thing I got fixed.
I am positive that my old .htaccess file looked like this:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule (.*) [domain.com...] [R=301,L]
Doesn't that look allrigt to you guys? Anyay it does not seem to work anymore for some reason.