I have my site www.mysite.com Let's say I want to change my domain to www.mysite2.com If someone sees a link on a search engine to www.mysite.com/stuff/random/index.htm and clicks it, can I redirect it to www.mysite2.com/stuff/random/index.htm Is there something I can add to .htaccess?
At mysite.com/.htaccess Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^([^.]+)$ http://www.mysite2.com/$1/ [R=301,L] or try RewriteRule ^(.*)$ http://www.mysite2.com/$1/ [R=301,L] if some stuff doesn't redirect right. This would redirect everything from tetrahost.net to the other host.
I went to + reputation to nintendo for such a helpful post (apache mod_rewrite rules suck big time and us newb's need to be spoon fed forever - props to those that don't get tired of it). Then I realized - holy cow, is that long list of green stuff his reps? Wowzer!
Ok, stupid question - I want to change may domain from xyz.com to abc.com - I get the whole .htaccess thing except - do I put that .htaccess in the original domain or the new one and if I put it in the original, that would mean I need to keep the old domain name too? And if that's right, then how long would you keep it? sigh.
.htaccess file goes on your old domain, and you need to keep your old domain name until most of your visitors have stopped going via the old site. Search engines should stop spidering/indexed the old site after a few months. Cryo.