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.

Addon domain

Discussion in 'General Discussion' started by Crundy, Oct 9, 2003.

  1. Crundy

    Crundy Active Member

    Joined:
    Oct 9, 2003
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    I have an account with a webhost using WHM/cPanel and I have a main domain, domain1.com set up. I added domain2.com as an addin domain pointing to a subfolder (which we'll call d2) and it seems to be fine if I go to http://www.domain2.com, but if I go to one of the subfolders within domain2, it redirects me to http://d2.domain1.com/folder/

    Does anyone know how to stop it from redirecting?

    cPanel.net Support Ticket Number:
     
  2. slacker8090

    slacker8090 Registered

    Joined:
    Oct 9, 2003
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    same issue here. bump.

    cPanel.net Support Ticket Number:
     
  3. Crundy

    Crundy Active Member

    Joined:
    Oct 9, 2003
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    OK, I've got a little further on this. It seems the problem is because of UseCanonicalName in the httpd.conf file. My host has said that they can't turn this off because it would break other people's settings, and so I've asked if they can alter httpd.conf to include:

    <Directory "/home/myusername/public_html">
    AllowOverride Options
    </Directory>

    So that I can make an htaccess file in the subdirectory with UseCanonicalName off in it which should fix it.

    The problem is because of trailing slashes. Using the example above:

    http://www.domain2.com/dir
    will redirect to http//d2.domain1.com/dir

    but:

    http://www.domain2.com/dir/
    Works fine.
     
  4. manokiss

    manokiss Well-Known Member

    Joined:
    Mar 31, 2002
    Messages:
    571
    Likes Received:
    0
    Trophy Points:
    16
    hello, we should expect any fix from Cpanel? or this is something without relation in the addon creation procedure through Cpanel?

    Thank you!
     
  5. Crundy

    Crundy Active Member

    Joined:
    Oct 9, 2003
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    Hmm, my host added "AllowOverride Options" and even tried "AllowOverride All" but I still got the error "UseCanonicalName not allowed here" if I tried to put "UseCanonicalName off" in an htaccess file. Anyone know why?

    Is there any point having UseCanonicalName on for anything? Wouldn't it be better for me to just ask them to set UseCanonicalName off in my virtual server entry in the httpd.conf? Would it break anything?
     
  6. B12Org

    B12Org Well-Known Member

    Joined:
    Jul 15, 2003
    Messages:
    692
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Seattle Washington
    cPanel Access Level:
    Root Administrator
    You just setup a forwarding in your access file, or in cpanel, that if the user types in the url that does not work, it gets forwarded to the one that does, and make it permanent. That should work
     
  7. Crundy

    Crundy Active Member

    Joined:
    Oct 9, 2003
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    Seems a bit irritating having to do that for every directory!

    I suppose it would be better than messing around with the httpd.conf file! Thanks for the tip.
     
  8. Crundy

    Crundy Active Member

    Joined:
    Oct 9, 2003
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    Got it!!

    I managed to sort it out. If anyone's interested, here's how:

    In the subdirectory for the domain (e.g. test for www.domaintest.com) I created an htaccess file with this in it:

    RewriteEngine on
    RewriteBase /test/
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^(.+[^/])$ $1/ [R]

    But obviously change 'test' to the name of the directory you're using.
     
    #8 Crundy, Nov 6, 2003
    Last edited: Nov 6, 2003
Loading...

Share This Page