views:

216

answers:

2

Domain1 uses root /

I am trying to have Domain2 use /domain2

When I visit domain2.com, I want it to appear as domain2.com and use the files from /domain2 instead of root /

The closest I got was:

RewriteEngine on  
RewriteCond %{HTTP_HOST} ^domain2\.com$ [NC]  
RewriteRule ^/?$ /domain2/$1 [L]

But if I try to go to some page at domain2/page.html it doesn't work, even though that page.html exists in the domain2/ folder

Any help is greatly welcomed. Thank you

+1  A: 

This requires a <VirtualHost> entry with a separate DocumentRoot. This cannot be done in a .htaccess file.

Ignacio Vazquez-Abrams
Can you provide more info on this method?
Chris B
http://httpd.apache.org/docs/2.2/mod/core.html#virtualhost http://httpd.apache.org/docs/2.2/mod/core.html#documentroot
Ignacio Vazquez-Abrams
A: 

Hi! I'm usig Linux, deluxe package. And I have several domains under it. In my root .htaccess I simply use redirect

redirect 301 /domain.local http://domain.local

Very simple

Under DNS settings You have also point to that directory ... and change A records. (just in case if You didn't do that)

in Total DNS

A Record domain.local   72.167.131.148

under hosting Domain Management add new domain (domain.local) and point it to /domain.local

where domain.local is Your domain

/via http://MediaBox.lv

Umbrovskis.com