_LOBO_
09-04-2003, 02:40 AM
My problem is that I want to have to websites www.test1.com and www.test2.com using the same hosting, for example if you write:
www.domain1.com you go to www.domain1.com/subdir/index.htm
www.domain2.com you go to www.domain2.com/subdir2/index.htm
both are in the same server.
I found that this can be achive changing the .htaccess file in the server, and I found this example, Im not and expert making this things and Ihope someone can tell me if this is correct.
Thank you in advance
---------------------CODE----------------------
ORIGINAL
# redirect domain2.com to subdir
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} domain2.com
RewriteCond %{REQUEST_URI} !subdir/
RewriteRule ^(.*)$ subdir/$1 [L]
MY CHANGES
# redirect test1.com to subdir <--I change here (I think subdir can be changed to my needs right?)
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} test1.com <--I change here
RewriteCond %{REQUEST_URI} !subdir/
RewriteRule ^(.*)$ subdir/$1 [L]
# redirect test2.com to subdir2 <--I change here
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} test2.com <--I change here
RewriteCond %{REQUEST_URI} !subdir2/ <--I change here
RewriteRule ^(.*)$ subdir2/$1 [L] <--I change here
-------------------end CODE------------------------
www.domain1.com you go to www.domain1.com/subdir/index.htm
www.domain2.com you go to www.domain2.com/subdir2/index.htm
both are in the same server.
I found that this can be achive changing the .htaccess file in the server, and I found this example, Im not and expert making this things and Ihope someone can tell me if this is correct.
Thank you in advance
---------------------CODE----------------------
ORIGINAL
# redirect domain2.com to subdir
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} domain2.com
RewriteCond %{REQUEST_URI} !subdir/
RewriteRule ^(.*)$ subdir/$1 [L]
MY CHANGES
# redirect test1.com to subdir <--I change here (I think subdir can be changed to my needs right?)
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} test1.com <--I change here
RewriteCond %{REQUEST_URI} !subdir/
RewriteRule ^(.*)$ subdir/$1 [L]
# redirect test2.com to subdir2 <--I change here
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} test2.com <--I change here
RewriteCond %{REQUEST_URI} !subdir2/ <--I change here
RewriteRule ^(.*)$ subdir2/$1 [L] <--I change here
-------------------end CODE------------------------