Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Dec 2010
    Location
    Australia
    Posts
    356
    Thanks
    143
    Thanked 0 Times in 0 Posts

    subdomain not being php-parsed

    a subdomain directory is treated as a root in its own right, right?

    well i have www.domain.com

    and now i've set up

    http://forums.domain.com as well (the directory of which is domain/forums)

    php parsing is fine for www.domain.com
    but it appears php is not being parsed in http://forums.domain.com

    what do you think's going on, and how do i fix this?

    Edit: Ok, I suspect is has something to do with .htaccess. I read somewhere GoDaddy does not allow .htaccess in subdirectory-based subdomains. But I thought that since forums.domain's root actually lies under domain (in domain/forum) that all of .htaccess settings would also apply to the subdirectory for my subdomain...
    Last edited by ptrcao; 02-17-2011 at 05:33 PM.
    The website I am building is http://www.mathannotated.com. My questions often pertain to it. This is my site plan: http://www.mathannotated.com/images/...ctory-tree.gif
    Thank you for your help in all matters. All earnest efforts in helping me will be credited with Thanks. -ptrcao

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    This sounds like a webserver configuration problem to me, not a PHP one. Have you checked with your host on configurations (or reviewed your own if you host)?
    Is the subdomain a part of your public_html, or is it served outside of it?
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #3
    Regular Coder
    Join Date
    Dec 2010
    Location
    Australia
    Posts
    356
    Thanks
    143
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fou-Lu View Post
    This sounds like a webserver configuration problem to me, not a PHP one. Have you checked with your host on configurations (or reviewed your own if you host)?
    I don't know what to look for. Except I have a hunch .htaccess may be relevant.

    Quote Originally Posted by Fou-Lu View Post
    Is the subdomain a part of your public_html, or is it served outside of it?
    I don't know what public_html refers to, but my subdomain is served by the same hosting server as the domain. The directory structure is the typical one.

    domain/forums is the directory for my subdomain, so it falls under the domain's directory.

    (the subdomain's URL is http://forums.domain.com/.)

    Does that answer the question?
    The website I am building is http://www.mathannotated.com. My questions often pertain to it. This is my site plan: http://www.mathannotated.com/images/...ctory-tree.gif
    Thank you for your help in all matters. All earnest efforts in helping me will be credited with Thanks. -ptrcao

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Yeah that does. If your domain is served than its a part of public_html (or whatever they have chosen to name it).
    It could be an .htaccess issue for sure. Check your domain level htaccess to see if it does things like addtype in it or anything with .php or x-httpd-php. Also check if there is a PHPINIDir in there if you are running as a cgi.
    If the subdirectory overrides some of these directives, than the PHP will not parse. Pathing is the only thing that could be an issue (such as the PHPIniDir if its pointing at the wrong spot) with this, since if your subdirectory restates the addtype directives than the override is just the same as the parent.

    Sounds to me like you are going to get in touch with your host. I assumed your subdomain is actually show the PHP code when you access the page is that right?
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #5
    Regular Coder
    Join Date
    Dec 2010
    Location
    Australia
    Posts
    356
    Thanks
    143
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fou-Lu View Post
    Yeah that does. If your domain is served than its a part of public_html (or whatever they have chosen to name it).
    It could be an .htaccess issue for sure. Check your domain level htaccess to see if it does things like addtype in it or anything with .php or x-httpd-php. Also check if there is a PHPINIDir in there if you are running as a cgi.
    If the subdirectory overrides some of these directives, than the PHP will not parse. Pathing is the only thing that could be an issue (such as the PHPIniDir if its pointing at the wrong spot) with this, since if your subdirectory restates the addtype directives than the override is just the same as the parent.

    Sounds to me like you are going to get in touch with your host. I assumed your subdomain is actually show the PHP code when you access the page is that right?
    Yep, exactly - PHP code was showing up instead of being executed.

    I mean since my subdomain is a subdirectory, I assumed the .htaccess at the higher level would apply to it as well. Is there a command to specifically enable (and disable) PHP-parsing for subdirectories in my master .htaccess file?
    The website I am building is http://www.mathannotated.com. My questions often pertain to it. This is my site plan: http://www.mathannotated.com/images/...ctory-tree.gif
    Thank you for your help in all matters. All earnest efforts in helping me will be credited with Thanks. -ptrcao

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Quote Originally Posted by ptrcao View Post
    Yep, exactly - PHP code was showing up instead of being executed.

    I mean since my subdomain is a subdirectory, I assumed the .htaccess at the higher level would apply to it as well. Is there a command to specifically enable (and disable) PHP-parsing for subdirectories in my master .htaccess file?
    That would be my assumption as well, but I'm afraid I'm not much of an apache wizard myself; my understanding is that .htaccess cascades through subdirectories, but perhaps this just isn't the case with subdomains (you can control enable/disable with the use of the addtype and I think its removetype directives, but I'm not sure if .htaccess allows directory level control of its subdirectories [I kinda think so], but I wouldn't do that myself - I'd add a .htaccess into the subdirectory which will unlink the relationship between the parent to the child directories).

    With the edit in your OP, does that mean you've gotten this resolved? Also, I'll move this to the apache configurations forum, since it really doesn't have anything to do with PHP.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #7
    Regular Coder
    Join Date
    Dec 2010
    Location
    Australia
    Posts
    356
    Thanks
    143
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fou-Lu View Post
    That would be my assumption as well, but I'm afraid I'm not much of an apache wizard myself; my understanding is that .htaccess cascades through subdirectories, but perhaps this just isn't the case with subdomains (you can control enable/disable with the use of the addtype and I think its removetype directives, but I'm not sure if .htaccess allows directory level control of its subdirectories [I kinda think so], but I wouldn't do that myself - I'd add a .htaccess into the subdirectory which will unlink the relationship between the parent to the child directories).

    With the edit in your OP, does that mean you've gotten this resolved? Also, I'll move this to the apache configurations forum, since it really doesn't have anything to do with PHP.
    Yes, I have successfully applied .htaccess in the subdomain's directory. But for other longstanding reasons I still want to know how to implement exceptions for subdirectories in my .htaccess file. In fact, weeks ago you were the very person I asked this question (see http://www.codingforums.com/showthre...57#post1041557), but I don't remember that we reached any solution and the original thread remained unresolved. Now that I put it to you again, you mentioned

    ... but I'm not sure if .htaccess allows directory level control of its subdirectories ...[I kinda think so]
    Are you any wiser since the last time I put this question to you?

    Can anyone help me here?

    (PS. Yes, you can relocate the thread if you feel it appropriate.)
    Last edited by ptrcao; 02-17-2011 at 05:41 PM.
    The website I am building is http://www.mathannotated.com. My questions often pertain to it. This is my site plan: http://www.mathannotated.com/images/...ctory-tree.gif
    Thank you for your help in all matters. All earnest efforts in helping me will be credited with Thanks. -ptrcao


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •