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.

cPanel subdomains, mod_rewrite

Discussion in 'General Discussion' started by curioususer, May 8, 2005.

  1. curioususer

    curioususer Member

    Joined:
    Apr 30, 2005
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    I'm a cPanel newbie user here.

    I have a site with several parked domains, and I'm using mod_rewrite to make the content for each domain different.

    When I do that, subdomains break... all accesses to them get error 500 from Apache (see below), and nothing shows up in the cPanel error log.

    None of the mod_rewrite rules in my .htaccess file would match the subdomain name, except the very last one, which redirects to my own error page... but I don't get that page, I get a generic one from Apache.

    I know it is the .htaccess from the main domain causing problems, because when I remove it, the subdomain works, giving me a directory listing of the subdirectory!


    1) given that the subdomain gets its own subdirectory, why would the .htaccess for the main domain cause problems?

    2) given that the subdomain gets its own directory, and the root .htaccess file causes problems for it, I experimented with adding an empty .htaccess file in the subdirectory of the subdomain, thinking that it would be used instead of the main one. But no go.

    3) So given that there is some interaction there, just what is it? What Apache functions does cPanel use to define the subdomains? And how and where?


    I have some other, possibly related, questions I'll put in other threads, but maybe reading them all will give a clearer picture of the sorts of things I'm having problems with, and it could be that one key piece of misunderstanding on my part is causing them all.



    Here is the error from Apache:

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, wwwadmin@jjfulano.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
     
  2. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,192
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    Root Administrator
    cpanel adds a complete virtualhost entry for the subdomain inside the apache configuation.

    also can u paste the contents of your .htaccess file here.
     
  3. curioususer

    curioususer Member

    Joined:
    Apr 30, 2005
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    So to the extent that I understand Apache, each virtual host is/should be independent of the others. And so why would the .htaccess from one virtual host affect another?

    Can anyone provide the set of commands that cPanel puts in the virtual host configuration? Both for a domain, and for one of its subdomains? Altering the domain name for privacy would be fine.

    Reading that section may provide much enlightenment to me, I would appreciate it.
     
  4. anup123

    anup123 Well-Known Member

    Joined:
    Mar 29, 2004
    Messages:
    897
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    This Planet
    Could you try plaing the rewrite_rules in httpd.conf and see if it works.
    .htaccess is recursive ... as far as i know.

    Thanks
    Anup
     
Loading...

Share This Page