Results 1 to 3 of 3

Thread: 500 Internal Server Error - Htaccess

  1. #1

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,356
    Rep Power
    17

    500 Internal Server Error - Htaccess

    Hello.

    Can anyone advise why powweb servers are SOO SOO Fussy ?

    Ive got an existing PHP script... - index.php, i copy / rename the file so there are two files

    a) index.php
    b) residential.php

    *EVERYTHING* about this new subdomain works fine - all the htaccess works fine... However I add 1 line to the htaccess file & call / activate the residential.php file & now i'm getting 500 server error FOR THIS URL/TASK.

    All the other parts of my subdomain work fine, as it should...

    Can anyone advise what is wrong with the last line of this file


    RewriteEngine on

    RewriteRule ^accronymn /index.php?type=accronymn

    RewriteRule ^(gb\-[a-zA-Z]+) index.php?type=$1 [NC,L]
    RewriteRule ^gb/1 index.php?type=gb&areasort=1 [NC,L]
    RewriteRule ^gb/2 index.php?type=gb&areasort=2 [NC,L]
    RewriteRule ^gb /index.php?type=gb [NC,L]
    RewriteRule ^todo /index.php?type=todo [NC,L]
    RewriteRule ^residential /residential.php [NC,L]
    Im going out to lunch.. back later

    Is powweb too fussy ? or is there a mistake somewhere ? (im betting that when i get home in a few hours the new URL works exactly like it should...)


    The PHP script is here (I took a LOT of it out - to see what is causing the 500 error.)


    <?

    // ini_set("log_errors", 1);
    // error_reporting(E_ALL);

    $log=1;
    $mainlog="\n\n====================\nStart residential.php \n";

    $dt=date('YmdH');
    ini_set("error_log", "/home/users/PATH/PATH/htdocs/mainreportresA$dt.err");

    require_once ("initial.inc.php");
    require_once ("general.inc.php");

    logit($mainlog);
    echo "<pre>$mainlog</pre>\n";
    exit;

    ?>
    1) I do get error logs for my index.php I do *NOT* get any error logs for this new file....

    2) Website says "More information about this error may be available in the server error log."

    I check the error logs https://ops.powweb.com/controlpanel/...giErrorLog.bml and it has PERL (CGI) errors, and NO PHP errors..

    Apart from where i set the logs to be in ini_set("error_log",, where are the "server" error logs ??

    Can we access them ad-hoc - without communicating with powweb staff ??

  2. #2

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,356
    Rep Power
    17
    Very frustrated, but its now working...

    All i did was put /residential$ (I found the $ thing in one of my old posts..)

    RewriteEngine on

    RewriteRule ^accronymn /index.php?type=accronymn

    RewriteRule ^(gb\-[a-zA-Z]+) index.php?type=$1 [NC,L]
    RewriteRule ^gb/1 index.php?type=gb&areasort=1 [NC,L]
    RewriteRule ^gb/2 index.php?type=gb&areasort=2 [NC,L]
    RewriteRule ^gb /index.php?type=gb [NC,L]
    RewriteRule ^todo /index.php?type=todo [NC,L]
    RewriteRule ^residential$ /residential.php [NC,L]
    Now /residential now works like the rest of the lines.

    QUESTION:-

    if it looks like a duck, it smells like a duck, it sounds like a duck - it should be a duck right ??

    Why is Powweb not accepting ducks - all the other lines work without a $, so whats different with /residential ??

    EDIT: Sent a support ticket to ask this question. (I asked a similar thing a few months ago, but didnt get a response.).
    Also suggested they add a new KB page for common HTACCESS problems/issues.

  3. #3
    Rick
    Join Date
    May 2002
    Location
    Minneapolis, MN
    Posts
    1,753
    Rep Power
    19
    I'm far from being an .htaccess expert, but I can tell you that this isn't a Powweb issue. It boils down to how regular expressions are processed for rewrites, etc. and I suspect it involved your "subdomain" which I haven't really grasped how you're implementing here (doubtlessly, my own fault).

    You do want to be careful when crafting open-ended regular expressions. Your code, for example, would match any URL that starts with 'gb' or 'todo'. Granted that this is very unlikely in your situation, but its still something to avoid in general. Throw in the 'NC' flag, and you're only increasing the risk of unintended matches.
    Rick Trethewey

Posting Permissions

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