Looking to Build/Redesign a Website or Blog ?

To speak to Rakshit, call +91 968 704 2303

Redirect one domain to another using .htaccess

Hello friends,

Are you looking for redirecting your website from one domain to another ? I was working for client who has a domain in .com and now they want to move full website into .ie domain. The problem is that all links has been crawled by major search engine. So if we remove all files from .com domain than it shows 404 not found (broken links) for .com domain links. Also we have to remove files to avoid duplicate content issues.

The solution is to redirect all request from .com to .ie. So we need to write rules in .htaccess file of .com domain which redirect all request from .com to .ie and we will not loose the visitors. Below are the rules which is useful for redirecting from one domain to another domain.

Options +FollowSymLinks
RewriteEngine on

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

Comment below if you have any query.

To know more about programming,JavaScript issues,jQuery,Expression Engine,MYSQL database and Open-source, enter your email address below. We will send you free tutorials.

Enter your email address:
 
Feel free to ask any question. Just leave your comment below and we will answer your comment with in 24 hours.
Share:

2 Comments

Leave a Reply

Your email address will not be published.