Redirect from one website url to another url


You can redirect website url to another url using .htaccess file. write following code into .htaccess file and put this file into root folder of your old website. This code is tested at apache server on linux hosting.

RewriteCond %{HTTP_HOST} ^http://www.oldwebsite.com [NC]
RewriteRule ^(.*)$ http://www.newwebsitedomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www.oldwebsite.com [NC]
RewriteRule ^(.*)$ http://www.newwebsitedomain.com/$1 [L,R=301]
Advertisements

3 thoughts on “Redirect from one website url to another url”

  1. Generally I don’t learn article on blogs, however I wish to say that this write-up very pressured me to check out and do it! Your writing style has been amazed me. Thanks, very great article.

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