Roll of primary domain & secondary domains

Sep 28, 2015
15
0
51
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
First i checked everything with WordPress (.htaccess, relocate method, disabling/removing all plugins, clearing cache, Nothing helped.
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.
 
Sep 28, 2015
15
0
51
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
P.S All addon-domains are inside public_html (as home/user/public_html/addon-domain.com)
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.
 
Sep 28, 2015
15
0
51
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
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.
 
Sep 28, 2015
15
0
51
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
I am happy to see it's now working as expected. Thank you for updating us with the outcome.