Masterdomain/Sub-Domain redirection

deddy

Well-Known Member
Oct 13, 2003
147
1
168
Masterdomain : domain.com
Subdomain : shop.domain.com

domain.com is redirected to http://www.domain.in/frameset.html

.htaccess entry:
RedirectMatch temp ^/index.html$ http://www.domain.in/frameset.htm

shop.domain.com is pointing to subdirectory "shop" within the masterdomain.

Problem :

Domain redirection of http://www.domain.com is working properly.
http://www.domain.com/shop/ is working properly.

http://shop.domain.com is not working properly because this address is also
redirected to http://www.domain.in/frameset.htm and got no chance to reach
subdirectory "shop".

RewriteEngine on
RewriteCond %{HTTP_HOST} ^shop.domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.shop.domain.com$
RewriteRule ^(.*)$ http://www.domain.com/shop/$1 [R=301,L]

is working but as http://www.domain.com/shop/

Why isn't it possible to get http://shop.domain.com also working.

httpd.conf looks fine :
ServerName shop.domain.com
ServerAlias www.shop.domain.com
ServerAdmin [email protected]
DocumentRoot /home/username/public_html/shop
CustomLog domlogs/shop.domain.com combined
ScriptAlias /cgi-bin/ /home/username/public_html/shop/cgi-bin/

DocumentRoot is not accepted as long as the .htaccess file within the public_html
directory is redirecting the masterdomain :confused: