Forum Moderators: phranque

Message Too Old, No Replies

Using .htaccess to host multiple domains on one hosting account

multiple domain hosting on single account using .htaccess

         

mnathani

6:07 pm on Apr 30, 2007 (gmt 0)

10+ Year Member



http://www.example.com is my main domain.
whose document root is /

[xp1.quux-foo.org...] is the additional domain I would like to use. Its document root is /test . This portion is working right now

When requesting [xp1.quux-foo.org...] for example I would like to use /test/blog as the root. Right now it is simply using /blog

Contents of current .htaccess located in root of http://www.example.com (main domain)

Options +Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} xp1.quux-foo.org$ [NC]
RewriteCond %{REQUEST_URI} !^/test/.*$
RewriteRule ^(.*)$ /test%{REQUEST_URI} [L]

[edited by: jdMorgan at 6:31 pm (utc) on April 30, 2007]
[edit reason] Examplified. Please see TOS. [/edit]

g1smd

6:50 pm on Apr 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What happens when you do have a trailing slash on the requested URL?

xp1.quux-foo.org/blog/

mnathani

7:09 pm on Apr 30, 2007 (gmt 0)

10+ Year Member



When accessing xp1.quux-foo.org/blog/ with the trailing slash, It shows xp1.quux-foo.org/blog/ in the url but shows the same content as http://www.example.com/blog rather than http://www.example.com/test/blog