Jump to content

Recommended Posts

I've searched on both google and on these forums and couldn't find an aswer.

 

Basically, the following line is in my .htaccess:

 

ErrorDocument 404 /404.php

 

You would think...ok, place 404.php in your base directory (where the .htaccess is) and it should load it; instead, I get the generic google chrome 404 error.

 

This is my entire .htaccess file incase that helps (if you see any other bugs or misswriten items, feel free to let me know  :D)

 

# Prevent indexing where not wanted (everywhere)

IndexIgnore *
Options -indexes

# Secure important files

<FilesMatch "^(config|core|.server_config).php$">
	Deny from All
</FilesMatch>

# Error document

ErrorDocument 404 /404.php

# Rewrite Mod

<IfModule mod_rewrite.c>

	# Enable rewrite engine
		RewriteEngine on

	# Allow real directories and files
		RewriteCond %{REQUEST_FILENAME} !-f
		RewriteCond %{REQUEST_FILENAME} !-d

	# ...And the rewrite rules
		RewriteRule ^([^/\.]+)$ load.php?load=$1 [QSA,L]

</IfModule>

# Disable server signature

ServerSignature Off

Link to comment
https://forums.phpfreaks.com/topic/171752-errordocument-404-404php-not-working/
Share on other sites

Your syntax looks fine. I'm not sure what you mean by....

 

nstead, I get the generic google chrome 404 error.

 

Error documents are always generated by the server in question. Maybe chrome displays its own googl'ised error page when it receives a 404?

If I were to go to http://www.phpfreaks.com/randomrandomaduiashfiasdfas.php, I get a custom 404 error page that php freaks set up.

 

If I go to a website that does not have a 404 page set up, google chrome will display a generic one. Same with firefox.

 

That's my problem. My wamp server isn't displaying the 404.php file when I access a page that does not exist. Since it's not doing this, chrome is just dishing out the standard 404 error. It looks something like this:

 

google-chrome-hijack.jpg

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.