htaccess code for forwarding a domain

Issue :

The old domain ( with and without ‘www’ ) needs to be forwarded to a sub-folder of the new domain.

Solution :

Use the following htaccess code :

RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$
RewriteRule ^(.*)$ http://newdomain.com/folder/$1 [R=permanent,R]

Filed Under: Quick fixesTechnical

Tags:

About the Author: InstaCarma is a provider of Enterprise Class Solutions for the Hosting Industry

RSSComments (0)

Trackback URL

Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes
InstaCarma provides outsourced web hosting technical support, helpdesk management, datacenter automation, cloud service management. Sales - 1800 810 6547 - visit www.instacarma.com