Hi...I am looking to redirect ALL the traffic from one site to another on the same server. the traffic is from thousands of links in the search engine and many are dead links going to a 404 error...I am looking to redirect all the traffic and wondered if this would be done through .htaccess or another way...Any help or alternative solutions would be appreciated...Thanks
Add a normal .htaccess permanent redirection rule in your old domain pointing to your new domian and the following rewrite rule in your new one OLD DOMAIN: Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L] Code (markup): NEW DOMAIN Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www\.[a-z-]+\.[a-z]{2,6} [NC] RewriteCond %{HTTP_HOST} ([a-z-]+\.[a-z]{2,6})$ [NC] RewriteRule ^/(.*)$ http://%1/$1 [R=301,L] Code (markup):
for redirects another way is using php if you want to redirect any page or any site to another just just add this in a file <? header('Location: http://www.sitename.com'); ?> and save this with name index.php thats it
IMHO, if using PHP you should do: <? header("HTTP/1.1 301"); header("location: http://your_new_page.com"); ?> Firstly you say, that the age was moved permanently, and then redirect user to your page cheers