-1

I thought i had the 404 set to go to 404.php, but i also have Mod_rewrite set to drop .php, so i dropped the .php in the htaccess file.

Here is what i have,

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST> order deny,allow deny from all allow from all </Limit> <Limit PUT DELETE> order deny,allow deny from all </Limit>

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) $1.php [L]

ErrorDocument 404 /404

But if you load a random page name it doesn't go to 404.php anymore.

Where did i go wrong?

anubhava
  • 761,203
  • 64
  • 569
  • 643
Kaff1n8t3d
  • 81
  • 1
  • 8

1 Answers1

0

ErrorDocument 404 /404

should be

ErrorDocument 404 /404.php

check the Apache log - it will say it can't find the file "404"

The RewriteEngine rules dont apply to errordocument.

David Xu
  • 5,555
  • 3
  • 28
  • 50
  • I found it here actually. http://stackoverflow.com/questions/12459720/mod-rewrite-htaccess-causing-500-server-error-if-url-does-not-exist?rq=1 Sorry to waste some space, but i didn't see it on my initial search. This solved my issue and explained what was happening. Great stuff! – Kaff1n8t3d Jun 13 '14 at 23:54