Redircting folder to new domain

Hi,

I need on help on the following things:

Right now I have:
http//www.domain.com => files on root folder.
http//www.newdomain.com => /newdomain

If somebody access http://www.domain.com/newfolder/file.html it will redirected to http://www.newdomain.com/file.html

Regards,
Sajan

I don’t quite understand the question. Are you asking how to direct a domain to a subfolder?

Subfolder needs to redirected to different domain.

Sajan,

Was there a question in that? Perhaps “How do I …?”

No worries. In your newdomain directory, include an .htaccess file with the following:

RewriteEngine on
RewriteCond %{HTTP_HOST} !newdomain\\.com$ [NC]
RewriteRule ^/?(.*)$ http://www.newdomain.com/$1 [R=301,L]
# Sorry for the /? in this code but, as a subdirectory of domain.com, there should (?) be a leading / in the {REQUEST_URI} received by the newdomain/.htaccess file.

Of course, that will redirect ANY/ALL file within the newdomain directory to the newdomain.com domain (without the subdirectory).

Since I’ve covered all that (and MUCH MORE) in my signature’s tutorial, I’ll leave the explanation to your reading. Don’t worry, if you don’t understand, please come back (or PM directly) with questions.

Regards,

DK