subdomains redirecting when they shouldn't

swagger

Registered
Jun 26, 2007
2
0
51
cPanel 11.24.4-R34548 - WHM 11.24.2 - X 3.9

I'm doing maintenance on a client's cPanel system. He recently had someone else working on it, but I don't know what all was done. When this other person was done with it, all his subdomains became redirects (sub.example.com redirecting to www.example.com/sub).

I went in and removed the redirect on one of the subdomains, and now sub.example.com is redirecting to www.example.com/index.php. If I load www.example.com/sub, the site loads as it's supposed to.

I've checked for .htaccess issues, httpd.conf and looked for any custom includes for that domain (none existed). I've also found the cPanel apache config at /var/cpanel/userdata/<user>/sub.example.com and everything in there looks fine - the data in there matches what's in httpd.conf.

I'm not a cPanel guru or anything, but I'm fairly proficient with apache and I think I've been fairly thorough in looking for what's causing this from an apache perspective.

I've found lots of info via google on how to set up a redirect, but nothing on how to solve for an unwanted redirect.

Any tips?

TIA
 

hzJayJ

Well-Known Member
Nov 14, 2008
76
1
58
Hello,

Please check the settings for the sub-domain in the cPanel.

cPanel >> Subdomains.

These will be the options you will see for setting a subdomain.

Subdomains Root Domain Document Root Redirection Actions

Please check whether the document root and the redirection are set correctly.

You could disable redirection by going to the following location of cPanel.

cPanel >> Subdomains >> manage redirection (for the respective sub-domain)

click Disable redirection to disable the redirection.
 

swagger

Registered
Jun 26, 2007
2
0
51
Hi,

Thanks for the reply.

I've already done all that - I pulled my hair out over this for the better part of a day and went through pretty much every setting I thought even might have some effect, as both the non-privileged user and the cPanel admin.

I'm thinking that it may have something to do with ExpressionEngine, which is what the client is running on that site, although if I load the subdomain content by accessing it via the directory (www.example.com/subdomain/) it works...

It's terribly frustrating. :mad:
 

avera

Registered
Jan 14, 2010
2
0
51
I am experiencing exactly the same problem. Did anyone ever find a resolution to this issue?
 

jannollo

Registered
Mar 10, 2010
2
0
51
I'm having the same problem, but it gets even weirder: One sub domain works as it should, the others not. Any ideas?
 

jannollo

Registered
Mar 10, 2010
2
0
51
Ok, I think my problem was the .htaccess. The subdomain pointed to a subfolder of a Drupal 5 install which has an .htaccess like this:
[drupal] Contents of /drupal/.htaccess

Moving the folder out of the Drupal root solved my problem. I'm not sure which part of the .htaccess was causing problems.