Redirect from one website url to another url


PHP Technology Tutorials

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]

View original post

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