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.

Prevent .htaccess redirection from affecting addon domains

Discussion in 'General Discussion' started by nerbonne, Feb 18, 2008.

  1. nerbonne

    nerbonne Well-Known Member

    Joined:
    Aug 19, 2007
    Messages:
    52
    Likes Received:
    1
    Trophy Points:
    6
    Anyone know how to keep .htaccess redirection from affecting my addon domains.

    I have this line in the .htaccess for the main site:

    Redirect /index.html http://somesite.com/gallery/main.php

    The problem is that all addon domains get redirected as well?
     
  2. twhiting9275

    twhiting9275 Well-Known Member

    Joined:
    Sep 26, 2002
    Messages:
    538
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Because all addons are placed in the public_html/addondomain folder (by default), yes, this is going to happen.

    How to stop this from happening? Move the addon domain to /home/user/addondomain, not /home/user/public_html/addondomain/ Or, you can just use the redirect in the gallery subdirectory itself.

    .htaccess controlls ALL directories under the main directory. This means that if you have something in public_html/.htaccess , it will, rightfully control public_html/directory1 , public_html/directory2 , public_html/directory3 and public_html/ itself.
     
Loading...

Share This Page