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.

Roll of primary domain & secondary domains

Discussion in 'Bind / DNS / Nameserver Issues' started by Zaheer Ahmad Khan, Dec 28, 2015.

  1. Zaheer Ahmad Khan

    Joined:
    Sep 28, 2015
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Pakistan
    cPanel Access Level:
    Root Administrator
    Hello,
    i have faced a strange issues and i am pretty confused what are the actual reasons behind it.
    Here is my scenario,
    I have a cPanel/WHM server with one account & with 20+ addon-domains in the account (All WordPress), the primary domain is Not pointed on this server. Well all domains (wordpress sites i mean) are working fine. The issue is with WordPress Admin Area.
    1. i typed http://mydomain.com/wp-login.php (Goes to admin login without any issue)
    2. when i typed http://mydomain.com/wp-admin/ (fine as well)
    3. when i typed http://mydomain.com/wp-admin (Without trailing slash) it redirects to http://mydomain.myprimarydomain.com/wp-admin/ (Hence Not found as myprimarydomain.com is Not hosted/pointed to this server)

    Here is what i did,
    First i checked everything with WordPress (.htaccess, relocate method, disabling/removing all plugins, clearing cache, Nothing helped.
    Next i checked DNS issues , everything fine as checked by intodns.com & mxtoolbox
    Next i checked apache logs, error logs, nothing found.

    Later i point my primary domain to this server & all is fine, even the 3 point , http://mydomain.com/wp-admin successfully going to mydomain admin area (instead of redirecting to http://mydomain.myprimarydomain.com/wp-admin/ )

    So i am confused what was the issue actually, is primary domain necessary to be pointed the same server & what is co-relation of primary domain to all secondary domains.

    Looking forward.
    Kind Regards
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    651
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you verify if you reviewed the .htaccess file for Mod_Rewrite rules in the public_html directory itself, in addition to the document root of the addon domain name?

    Thank you.
     
  3. Zaheer Ahmad Khan

    Joined:
    Sep 28, 2015
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Pakistan
    cPanel Access Level:
    Root Administrator
    Micheal i tried by removing / renaming / copy-pasting default WP htaccess, no luck. Below is my htaccess (default)
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    P.S All addon-domains are inside public_html (as home/user/public_html/addon-domain.com)

    Kind Regards
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    651
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    For instance, did you review the .htaccess file within /home/$user/public_html/addon-domain.com in addion to the .htaccess file within the /home/$user/public_html directory? Does the issue persist when the .htaccess files are completely empty?

    Thank you.
     
  5. Zaheer Ahmad Khan

    Joined:
    Sep 28, 2015
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Pakistan
    cPanel Access Level:
    Root Administrator
    Yes, as i told, i tried all with removal of htaccess files (from primary domain e.g. under public_html/ & from public_html/addon-domain.com/)
    This makes no difference.
    I think while primary domain pointed to some other server secondary domains should work, isn't it?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    651
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
  7. Zaheer Ahmad Khan

    Joined:
    Sep 28, 2015
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Pakistan
    cPanel Access Level:
    Root Administrator
    Well Michael, i have sorted out this issue as i told by pointing myprimarydomain.com to this server. & everything working as it should.
    Interesting thing is this,
    before pointing my primary domain to this server
    all my addon-domains.com/wp-admin were being redirected to http://mydomain.myprimarydomain.com/wp-admin/ resulting 404 error.
    But after now as myprimarydomain.com is pointed to this server, all http://addon-domains.com/wp-admin are Not redirecting & working as desired

    Kind Regards
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    651
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page