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

Link to comment
Share on other sites

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.