The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Masterdomain/Sub-Domain redirection

Discussion in 'General Discussion' started by deddy, Feb 16, 2005.

  1. deddy

    deddy Well-Known Member

    Joined:
    Oct 13, 2003
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    16
    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 wwwadmin@shop.domain.com
    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:
     
Loading...

Share This Page