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.

Problems with Subdomains

Discussion in 'General Discussion' started by emmunity, Aug 14, 2006.

  1. emmunity

    emmunity Member

    Joined:
    Aug 2, 2006
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
  2. 1a-Websolutions

    1a-Websolutions Active Member

    Joined:
    Aug 24, 2006
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Hey all,

    I have the same issue - Subdomains redirection dont work - i recieve a 404:

    Forbidden
    You don't have permission to access / on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    How cann I fix this?

    Regards

    WHM 10.8.0 cPanel 10.9.0-R37
    Fedora i686 - WHM X v3.1.0
     
  3. levelsupport

    levelsupport Well-Known Member

    Joined:
    Oct 7, 2006
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    can you paste me the contents of the .htaccess file you have on the directory you are redirecting.
     
  4. 1a-Websolutions

    1a-Websolutions Active Member

    Joined:
    Aug 24, 2006
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    this ist the content of my .htaccess:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^mail_1a-websolutions.ch$ [OR]
    RewriteCond %{HTTP_HOST} ^www.mail_1a-websolutions.ch$
    RewriteRule ^(.*)$ https://1a-websolutions.ch:2096/horde/login.php [R=301,L]

    Regards
     
  5. dreamwiz

    dreamwiz Well-Known Member

    Joined:
    Aug 28, 2003
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6
    same issues here too with redirects. Are you running latest current?
     
  6. 1a-Websolutions

    1a-Websolutions Active Member

    Joined:
    Aug 24, 2006
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Hey,

    you cann fix it easy:

    OLD:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^mail_1a-websolutions.ch$ [OR]
    RewriteCond %{HTTP_HOST} ^www.mail_1a-websolutions.ch$
    RewriteRule ^(.*)$ https://1a-websolutions.ch:2096/horde/login.php [R=301,L]

    NEW

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^mail.1a-websolutions.ch$ [OR]
    RewriteCond %{HTTP_HOST} ^www.mail.1a-websolutions.ch$
    RewriteRule ^(.*)$ https://1a-websolutions.ch:2096/horde/login.php [R=301,L]

    Change the Underline-Charakter to a Dot-Charakter bevor the Domainname....;) -

    Mayby a BUG by Cpanel???

    Regards
     
    #6 1a-Websolutions, Oct 8, 2006
    Last edited: Oct 8, 2006
  7. dreamwiz

    dreamwiz Well-Known Member

    Joined:
    Aug 28, 2003
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6
    well that fixed it, thanks!
     
  8. alwaysweb

    alwaysweb Well-Known Member

    Joined:
    Mar 8, 2002
    Messages:
    97
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Dallas, TX
    cPanel Access Level:
    Root Administrator
    That works for one subdomain, but you have to do it manually for each. I have some customers trying to set up dozens of subdomain redirects, and trying to explain to them how to fix this is not easy!

    Although not the best workaround, I was able to edit the file:

    /usr/local/cpanel/base/frontend/x/subdomain/doredirectdomain.html

    and change the hidden form field (around line #20) from:

    to:

    and it works properly.



    Cpanel should fix this bug by editing the listsubdomainsop() function call :

    <cpanel SubDomain="listsubdomainsop()">

    called from:

    /usr/local/cpanel/base/frontend/x/subdomain/index.html

    to send the user to doredirectdomain.html?domain=sub.domain.com

    instead of:

    doredirectdomain.html?domain=sub_domain.com

    as it does now! (note the "_" instead of a ".")
     
  9. cytexone

    cytexone Member

    Joined:
    Mar 13, 2004
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Awesome man, this fix worked. The only thing that doesn't work is when you edit an existing redirect it doesn't show what it's being redirected to...

    Is that the case?
     
  10. carverrn

    carverrn Member

    Joined:
    Jan 7, 2003
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Is this still a bug because we're using cPanel Version 11.6.0-RELEASE, cPanel Build 15076 and using Redirects from cPanel doesn't work for subdomains?

    I tried searching the cPanel bugs list and couldn't even find a report that sounded like this problem. Do they even know about the problem?

    My hosting companies tech support don't seem to understand what the problem is so I'm trying to figure it out so that I can explain it to them.
     
  11. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You're a little out of date there for RELEASE. Just so you know, http://changelog.cpanel.net/ details all the fixes in newly published builds.

    RELEASE Build 16789 fixed some more redirect issues.
     
  12. carverrn

    carverrn Member

    Joined:
    Jan 7, 2003
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Thank you DavidG.

    I will see if I can get my hosting company to update.

    In the mean time I think I found the problem. cPanel adds a RewriteRule of:

    RewriteRule ^pattern/?$ redirect_url [R=302,L]

    I think it should be something like:

    RewriteRule ^.*/pattern/?$ redirect_url [R=302,L]

    At least the redirect works correctly when I manually make this change to my .htaccess file.

    I will check updates to see if that problem was addressed.

    Regards,
    Rich
     
  13. carverrn

    carverrn Member

    Joined:
    Jan 7, 2003
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    I've looked through the Change Logs and searched the bug reports and I don't see a bug fix or report that matches this problem.

    My problem turns out not to be the "_" issue mentioned in this thread which was Bug # 4677.

    Regards,
    Rich
     
  14. carverrn

    carverrn Member

    Joined:
    Jan 7, 2003
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    I originally thought that the actual rule should be something like:

    RewriteRule ^.*/pattern/?$ redirect_url [R=302,L]

    But that messed up the cPanel Redirects listing of existing redirects.

    What does work correctly is:

    RewriteRule ^subdomain/pattern/?$ redirect_url [R=302,L]
     
Loading...

Share This Page