Support » How-To and Troubleshooting » PHP Files and 404/.htaccess Problem

PHP Files and 404/.htaccess Problem

  • A user on another (non-WordPress-related) forum posted about an error he (or she) was having where he created a custom 404 error page and pointed to it with the .htaccess file. His problem was, while the error file came up fine if a user typed in a path to a false .htm file, a different page came up for false .php files, a white page that only had the text, “No input file specified.” I found that this was the case for me, too: Typing in “http://www.sassydevil.com/blue.htm” or “http://www.sassydevil.com/blue” brings up the correct file, but “http://www.sassydevil.com/blue.php” does not.

    I tried the solution in the forum, to put the code below into the .htaccess file, but it didn’t work for me:

    RewriteEngine On
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
    RewriteRule (.+) /404.html

    I even tried changing the “404.html” to “404.php,” since my 404 file is a php file. I tried putting this below the code I have below the WordPress rewrite stuff, which is this:

    # END WordPress

    ErrorDocument 404 /index.php?error=404
    ErrorDocument 403 /index.php?error=403
    Options All -Indexes

    Can someone tell me what I need to do? Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP Files and 404/.htaccess Problem’ is closed to new replies.
Skip to toolbar