Forum Moderators: phranque
I have read through many of the 301 redirect posts but can't seem to find anything that is similar to my situation. Please help! Thanks.
Note: They use Apache.
Each site has a "site root," a directory in which the default HTML file resides (usually index.html). An .htaccess file containing your redirect should be placed in the site root directory of the domain you want to redirect.
Also, if you have access to the httpd.conf file, it defines the configuration for both domains. Instead of using .htaccess, your redirect could be added to the section defining the domain you want to redirect.
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?old_domain\.com
RewriteRule (.*) http://new_domain.com/$1 [R=301,L]
See the references cited in our Apache forum charter [webmasterworld.com] for more information about mod_rewrite.
Jim