Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

My hosting provider has problems. I put Drupal on a sub-domain of my site. When I try logging in or clicking a link it comes to a Internal server error. But if I navigate to the actual directory it works fine. What should I do?

Examples:

Works: sld.tld/subdomainroot/Y

Fails subdomain.sld.tld/Y

share|improve this question
    
What is the domain? Shared hosting? Do you have a hosting control panel like cPanel or Plesk? –  danlefree Dec 22 '11 at 21:55
    
I have several all of which are currently down (by my own doing to prevent people from seeing what I am currently working on). Yes. cPanel. –  MisterCrazy8 Dec 22 '11 at 22:02
1  
What do your Apache error logs for the subdomains show when a request errors out? Have you inquired about this issue with your hosting provider? –  danlefree Dec 22 '11 at 22:11

2 Answers 2

up vote 2 down vote accepted

Pending concrete info from the logs of both the subdomain and second-level domain, my best guess is that the problem is caused by, either:

  • having nested/overlapping document roots (which Apache generally does not like),
  • the subdomain is misconfigured in Apache
  • the Drupal install is configured to use the first web root

Generally web apps are designed to be accessed from a single web root. If you access it from another web root, the routing or URL rewrite rules could cause errors.

You really shouldn't have your domains set up like that anyway. Besides causing potential glitches, it's also insecure. I prefer a directory structure like this:

~/htdocs/domain1.tld/wwwroot
~/htdocs/domain2.tld/wwwroot
~/htdocs/sub.domain1.tld/wwwroot
~/htdocs/sub.domain2.tld/wwwroot

This way, you can keep secure files for each site/app outside of its doc root (as well as install shared libraries). In your current configuration, you could keep files above subdomainroot and it would still be accessible because it's in your parent domain's doc root.

share|improve this answer

In my case, the following was working: www.domain.com/subdomain

But subdomain.domain.com was not.

I realized that my default index was: /subdomain/index.htm. I renamed it to /subdomain/index.html.

Now, subdomain.domain.com is working.

Note: it should be place to force to look for index.htm too, but I think I can't access to those config files with my free account.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.