Jump to content

.htaccess deny from all affecting ability to access custom error pages


stickynote427

Recommended Posts

I'm trying to set up custom error pages on my Web site. I got the 404 page set up successfully, but once I try to make the 403 page, neither of the error pages work.

 

The following is the content of .htaccess in my public_html directory:

ErrorDocument 403 /pages/error_pages/403.php
ErrorDocument 404 /pages/error_pages/404.php

 

I can go to a nonexistent page and have the 404 page appear correctly.

 

Now, I don't want the /pages directory (which includes all directories and files in that directory) to be listed when someone visits there (www.example.com/pages), which is what happens right now. So, I create an .htaccess file in the /pages directory and enter the following:

deny from all

Now when I try to visit a nonexistent or disallowed page (anything in the /pages directory) I get the default error pages (not my custom ones).

 

I don't understand why this is happening. It seems to me that my server(?) or PHP is also being disallowed access to any files in the /pages directory. Shouldn't my site/server/whatever still be able to access anything on the server, and just someone browsing around my site can't?

 

If you need more info, please ask.

 

Thanks,

stickynote427

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.