Home > On-site Optimization > Redirect Old Domain to New Domain

Redirect Old Domain to New Domain


How to Redirect Old domain to New domain through .htacsess? Here are few code types which would allows to your website old domain to new domain. You should add this code in .htaccess file

Method First:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]

Method Second:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} \olddomain.com$
RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L

Method Third:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

Method Fourth:
Redirect 301 / http://www.newdomain.com/

Here are the few simple formats which also will come under 301 redirects related articles:

Note: sh404SEF redirect process for Joomla

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: