Forum Moderators: phranque
For example, my regular domain is www.maindomain.com I registered www.seconddomain.com. I would like www.seconddomain.com to point to www.maindomani.com/second
Is this possible? I want to give the illusion that my www.seconddomain.com site is on a different server.
Cheers,
Ed
Welcome to WebmasterWorld [webmasterworld.com]!
This is fairly easy if you can use mod_rewrite on your server.
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?seconddomain\.com
RewriteRule ^(.*)$ /second/$1 [L]
Things get a bit more complex if you are using scripts with query strings:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?seconddomain\.com
RewriteCond %{QUERY_STRING} ^product=(.*)$
RewriteRule ^(.*)$ /second/$1?product=%1 [L]
RewriteCond %{HTTP_HOST} ^(www\.)?seconddomain\.com
RewriteRule ^(.*)$ /second/$1 [L]
Ref: Introduction to mod_rewrite [webmasterworld.com]
HTH,
Jim