Forum Moderators: phranque
We purchased a domain name that fits it perfectly and uploaded the site to it about two years ago and it is doing well, however the old subdomain at www.mydomain.com is also doing well but they have almost identical content and both make good $ in AdWords.
We want to eliminate the sub domain and point all of the interior pages to the new domain, my question is: what is the best way to do this? I have the ISP redirecting the subdomain, but this only affects requests coming to the root and none of the files are redirected.
Thanks in advance...
<script>
window.location='http://www.yournewpage.com';
</script>
This works and returns a 200 response, I am wondering if this will cause problems with the se's thinking I am trying to spam them. Any thoughts?
Web hosts generally aren't too helpful with this stuff but you may still be able to get it done.
More info:
refresh vs 301: [w3.org...]
.htaccess: [httpd.apache.org...]
In the root this is what I added to .htaccess
redirect 301 /old/old.html [mysite.com...]
After the 500 server error I tried this:
RewriteEngine On
RedirectMatch permanent ^/old/old.html$ [mysite.com...]
same error...
RewriteEngine On
RewriteRule ^/old/old.html$ http://www.mysite.com/new.html [R=301,L]
Also, if the pages names will match on the new domain you might be able to get them all done at once with something like:
RewriteEngine On
RewriteRule ^/old/(.*)$ http://www.mysite.com/$1 [R=301,L]
Make sure you check your .htaccess file has UNIX line breaks instead of windows. Use a text editor that allows you to choose UNIX file type (like EditPlus) and make sure to set the file type as UNIX, or edit it from the command line with pico, vi, or emacs.
Finally, do you get an error on all pages of your site when that .htaccess is up or just the one in question?