Forum Moderators: phranque
I have moved around a couple of things on my server and I'm now having quite a lot of redirects;-)
They work perfectly and look like this:
Redirect permanent /site1.html http://domain.com/new_location/site1.html
I have a shared hosting plan running on freebsd, and could have setup a additional domain pointing to a subdomain of the main server. Now, all sites named site1.html on this additional domain name (a completely independent site!) are being redirected to the domain specified above which isn't really a desired effect....
It doesn't seem to be enough to just put a .htaccess file without these commands into the subdomain folder - the file keeps being redirected:(
Is there a way to "switch off" redirects being executed as defined in the .htaccess in the doc_root folder?
Any help greatly appreciated! Thanks
Nick
[edited by: jdMorgan at 10:43 pm (utc) on Jan. 30, 2006]
[edit reason] De-linked. [/edit]
Welcome to WebmasterWorld!
You'll need to use a similar construct in mod_rewrite to selectively redirect based on the requested hostname (domain):
RewriteCond %{HTTP_HOST} ^(www\.)?domain_to_be_redirected\.com
RewriteRule ^site1\.html$ http://domain.com/new_location/site1.html [R=301,L]
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim
I always was a little scared using the mod_rewrite feature:
`The great thing about mod_rewrite is it gives you all the configurability and flexibility of Sendmail. The downside to mod_rewrite is that it gives you all the configurability and flexibility of Sendmail.''
But I'll definitively have a look into it. Probably it'll be easier to solve than I think;-)
Cheers
Nick