Results 1 to 8 of 8

Thread: Htaccess - Internal Server Error

  1. #1

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,354
    Rep Power
    16

    Htaccess - Internal Server Error

    Hello. I'm updating one of my PHP scripts & getting Internal Server Error when i browse the website/page.

    This 1 php script controls the entire subdomain, so NOTHING works on that subdomain..

    can anyone help me with htaccess - to direct error logs into my subdirectory ?
    i CAN do it via php, however the php script is broke & i can't find the line number / error message that i'm trying to look for.

    My current htaccess looks like :-

    # supress php errors
    php_flag display_startup_errors off
    php_flag display_errors off
    php_flag html_errors off

    # enable PHP error logging
    php_value error_log /home/users/web/bCODE/pow.USERNAME/subdomains/SpaceScience/htdocs/mainreport.err
    However when i run the php script again, there is no error file... (the path name is correct in the htaccess file)

  2. #2

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,354
    Rep Power
    16
    Ps - ive been through my script (a tool i developed), & all my opening / closing brackets {} do match up...

    However I still do not know the nature of the error or line number to look....

  3. #3

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,354
    Rep Power
    16
    O'h well.. Imfrustrated.

    1) php.ini is all ON (for error reporting)

    2) ive turned ON all errors in my .htaccess file (below)..

    3) ALL pages of my website are working fine- except this /comets area. I just get the following error.

    4) NOTHING about this website / subdomain is being recorded in the server logs.

    Internal Server Error

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

    Please contact the server administrator, 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.

    and i'm STILLgetting the above message.

    PS - ive moved comets.php and comets.inc.php into the main directory (not /comets/ subdirectory.

    Ive been to a PHP syntax-error website & there are no errors found..

    CONCLUSION: php.ini is working (other pages in this website are working)

    CONCLUSION: htaccess is working (if ts at fault, NONE of my pages will be working..)

    Here is my current .htaccess.


    <Files *>
    Header set Cache-Control: "private, pre-check=0, post-check=0, max-age=0"
    Header set Expires: 0
    Header set Pragma: no-cache
    </Files>


    php_flag display_startup_errors on
    php_flag display_errors on
    php_flag html_errors on
    php_flag log_errors on
    php_value error_log /home/users/web/b2516/pow.USERNAME/subdomains/SpaceScience/htdocs/mainreport.err

    RewriteEngine on
    RewriteRule ^category/([a-zA-Z0-9_-\s\%]+) /index.php?category=$1 [NC]
    RewriteRule ^date/([0-9]+) /index.php?date=1&page=$1 [NC]
    RewriteRule ^date /index.php?date=1 [NC]
    RewriteRule ^updates /index.php?updates=1 [NC]
    RewriteRule ^craft/([a-zA-Z0-9_-\s\%]+) /index.php?craftfound=1&craft=$1 [NC]
    RewriteRule ^craft /index.php?craft=1 [NC]

    RewriteRule ^comets /comets.php [NC]

    RewriteRule ^location/([a-zA-Z0-9_-\s\%]+) /index.php?locationfound=1&location=$1 [NC]
    RewriteRule ^location /index.php?locations=1 [NC]
    RewriteRule ^contact /nwcontact.php?contact=1 [NC]
    RewriteRule ^recent /index.php?recent=1 [NC]
    RewriteRule ^clubs /index.php?clubs=1 [NC]
    RewriteRule ^links /index.php?links=1 [NC]
    RewriteRule ^events /index.php?events=1 [NC]
    RewriteRule ^observatories /index.php?observatories=1 [NC]
    RewriteRule ^([A-Z]{1})/?$ /index.php?listcategory=$1 [NC]
    Can anyone help:

    1) advise me how to turn error reporting to HYPERDRIVE - I want any / all known & unknown forms of logging to be turned ON - so i can figure this out...

    2) last ditch, i may give FTP access to someone -not to FIX -but to figure it out & teach me HOW they figured it out. - Volunteers ?

  4. #4

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,354
    Rep Power
    16
    htaccess validator gives all clear, Now my whole subdomain is broke - Server error (NOTHING recorded in powweb logs)

  5. #5

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,354
    Rep Power
    16
    Took out the htaccess 'error' lines & my website is working now - except the "comets" area.

    Current :-

    Code:
    <Files *> 
    Header set Cache-Control: "private, pre-check=0, post-check=0, max-age=0" 
    Header set Expires: 0 
    Header set Pragma: no-cache 
    </Files> 
    
    RewriteEngine on
    RewriteRule ^category/([a-zA-Z0-9_-\s\%]+) /index.php?category=$1 [NC]
    RewriteRule ^date/([0-9]+) /index.php?date=1&page=$1 [NC]
    RewriteRule ^date /index.php?date=1 [NC]
    RewriteRule ^updates /index.php?updates=1 [NC]
    RewriteRule ^craft/([a-zA-Z0-9_-\s\%]+) /index.php?craftfound=1&craft=$1 [NC]
    RewriteRule ^craft /index.php?craft=1 [NC]
    
    RewriteRule ^comets /comets.php [NC]
    
    RewriteRule ^location/([a-zA-Z0-9_-\s\%]+) /index.php?locationfound=1&location=$1 [NC]
    RewriteRule ^location /index.php?locations=1 [NC]
    RewriteRule ^contact /nwcontact.php?contact=1 [NC]
    RewriteRule ^recent /index.php?recent=1 [NC]
    RewriteRule ^clubs /index.php?clubs=1 [NC]
    RewriteRule ^links /index.php?links=1 [NC]
    RewriteRule ^events /index.php?events=1 [NC]
    RewriteRule ^observatories /index.php?observatories=1 [NC]
    RewriteRule ^([A-Z]{1})/?$  /index.php?listcategory=$1 [NC]

  6. #6

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,354
    Rep Power
    16
    Further http://ss.kwister.com/comets

    Using: http://web-sniffer.net/

    Connect to 65.254.250.109 on port 80 ... ok

    TRACE /comets HTTP/1.1[CRLF]
    Host: ss.kwister.com[CRLF]
    Connection: close[CRLF]
    User-Agent: Web-sniffer/1.1.0 (+http://web-sniffer.net/)[CRLF]
    Accept-Encoding: gzip[CRLF]
    Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7[CRLF]
    Cache-Control: no-cache[CRLF]
    Accept-Language: de,en;q=0.7,en-us;q=0.3[CRLF]
    Referer: http://web-sniffer.net/[CRLF]
    [CRLF]
    I've found a lot of websites in google to CAUSE http headers / eg 405's - But none to

    a) PREVENT 405s or

    b) Solve/ diagnose (suitable reasons why it is been caused.

  7. #7

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,354
    Rep Power
    16
    YAY!!! - Finally fixed.

    Though I have no idea what was wrong, or why it caused an error (i didnt learn anything)..

    the correct code is

    Code:
    RewriteRule ^comets/([a-zA-Z0-9_-\s\%]+) /cometsfound.php?cometfound=1&comet=$1 [L]
    RewriteRule ^comets/$ /comets.php [L]
    RewriteRule ^comets$ /comets.php [L]
    I did change the NC code to L, at the end of the line, though the error was 'fixed' LONG after i changed it to L. I dont know if that afftected anything & the rest of the lines are similar / the same as i had in the first place.

    Can anyone advise what the difference is between L & NC ? all the other lines on my htaccess are NC, & they work. So logically speaking, that shouldnt stop a website from working.


    (Im sad - didnt learn anything)

    EDIT: I wanted the 'main' part to work if i put domain.com/comets or domain.com/comets/ - the above code allows that.

  8. #8
    Thinkin' out loud again Builder's Avatar
    Join Date
    Nov 2002
    Location
    Illinois
    Posts
    2,088
    Rep Power
    19
    Glad you got it sorted out. Finally . While I'm no htaccess guru and can't tell you why changing from NC to L may have fixed things I can give you definitions as I understand them:
    NC = No Case. In other words comet, Comet, COMET will all trigger the rule.
    L = A stop command. If that rule is met, go no further.

    Since it seems you are using a "shorthand" with Condition/Rule all in one line it probably makes sense to have the L command at the end of each. If you want the No Case you can try [NC,L].

    A page that I find helpful:
    http://www.askapache.com/htaccess/htaccess.html

    Good luck,
    Kevin
    A good friend will come and bail you out of jail...
    but a true friend will be sitting next to you saying,
    "Damn... that was fun!"

Posting Permissions

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