beastnatch
11-29-2009, 07:53 AM
So I'm working with someone who change their domain from something like example.com to example.forumexample.com. I'm having him test the following code in the .htaccess file.
RewriteEngine On
rewritecond %{http_host} ^example.com
rewriteRule ^(.*) http://example.forumexample.com/$1 [R=301,L]
On my personal website I use that to just add the http://www to my webpages, but figured the same code could accomplish this. As soon as he gets back to me I'll verify that it even worked.
What the goal is, is to use example.com as a homepage containing the link to the new site. I want all the old links to be useable through google (and elsewhere) and not ding him for changing his domain (as they are not hosted at the old domain any longer). I think that will work. This was my bandaid for the problem with google links and such, but I would like however for the actual homepage to not forward to the new domain. Just everything else. Is there a way to create an exception in .htaccess to allow that one page to work without the forward?
Thanks
RewriteEngine On
rewritecond %{http_host} ^example.com
rewriteRule ^(.*) http://example.forumexample.com/$1 [R=301,L]
On my personal website I use that to just add the http://www to my webpages, but figured the same code could accomplish this. As soon as he gets back to me I'll verify that it even worked.
What the goal is, is to use example.com as a homepage containing the link to the new site. I want all the old links to be useable through google (and elsewhere) and not ding him for changing his domain (as they are not hosted at the old domain any longer). I think that will work. This was my bandaid for the problem with google links and such, but I would like however for the actual homepage to not forward to the new domain. Just everything else. Is there a way to create an exception in .htaccess to allow that one page to work without the forward?
Thanks