Forum Moderators: phranque
here is what im using
"
Redirect 301 / [$site$.com...]
"
It redirects the whole site.. but how can i stop it from redirecting say www.$#*$!$.com/folder/
Thank you.
Steve.
RewriteEngine on
RewriteRule !^the/pathto/the/directory - [C]
RewriteRule (.*) http://www.newsite.com/$1 [R=301,L]
This first rule checks to see if the requested URL is *not* the path to the directory you do not wish to redirect. If this is true (it is not the path) then the [C] (chain) will allow the rewrite to be executed, if it is not true (the path to the directory has been reqeusted) nothing will happen.
Hope this helps.
Justin
Options +FollowSymLinks
And if that fails, then please post the relevant error messages from your server error log so we can see what the problem might be.
Jim
To clearify:
I want to redirect all urls like www.old-xyzdomain.zz/anything to www.new-xyzdomain.zz/anything respectively, EXCEPT
a) www.old-xyzdomain.zz/forum/ which should not be redirected
and
b) the root url www.old-xyzdomain.zz/ which I want to redirect to www.old-xyzdomain.zz/forum/
How can I do that?
Edited: My original post was a mess.
[edited by: EsterA at 2:47 pm (utc) on Feb. 25, 2008]
For a simple solution, see Apache mod_alias [httpd.apache.org]' Redirect and RedirectMatch directives.
Jim