damiancds Posted April 13, 2010 Share Posted April 13, 2010 Lately I've been adding my own custom error pages and i decided to finish them out and add the 500,400,401,403, and 404 errorsI've got the 404, and 401 done,Working on the 403, i can't seem to get it to show up.my understanding of the 403 is that if someone goes to a directory, and it doesn't have any sort of index page, it would show the 403 error instead of a directory listing(i'd like to not show all my images and other resources as a directory, but serve up this 403 error instead.)In my .htaccess i have ErrorDocument 404 /system/error/not_found.php ErrorDocument 500 /system/error/internal_server_error.php ErrorDocument 400 /system/error/bad_request.php ErrorDocument 401 /system/error/auth_required.php ErrorDocument 403 /system/error/forbidden.php every page has been created, it's just that the forbidden.php page won't come up. Chances are I have the purpose of the 403 error mixed up so any clarification would be helpfulthanks, Link to comment Share on other sites More sharing options...
jeffman Posted April 13, 2010 Share Posted April 13, 2010 First you need to disable indexing. Add this to your .htaccess:options -indexes Link to comment Share on other sites More sharing options...
damiancds Posted April 13, 2010 Author Share Posted April 13, 2010 okay, sweet, it worked,but does that line have any side effects, I mean what exactly does "options -indexes" dodoes it just affect directories without indexes?thanks, Link to comment Share on other sites More sharing options...
jeffman Posted April 13, 2010 Share Posted April 13, 2010 Index files will perform as usual. This only disables the automatic indexing that would occur when an index file is not present. Link to comment Share on other sites More sharing options...
damiancds Posted April 13, 2010 Author Share Posted April 13, 2010 Okay, thanks for the reply,Feel better knowing exactly what it does,thanks, Link to comment Share on other sites More sharing options...
holmedwa04 Posted June 1, 2010 Share Posted June 1, 2010 Thats interesting that is! I used to have the same problem and thought it was something to do with the way my host had set up the server. I just ended up making an index file in each location that I wanted to hide the contents and then using a php include to server up the error message but it was a bit of a pain. I have moved hosts now and it just seems to work correctly. So I have gone back to the proper .htaccess way with it. But that is very useful for future reference. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.