PDA

View Full Version : 401 oddness



sarlee
02-21-2010, 06:07 PM
I have directories protected with .htaccess and the usual password setup. Everything seems to be working except when my custom 401 page is displayed I can still see the web page content by right clicking and hitting "view source". It shows the source for my protected web page, not the 401 error page. ANy ideas? Also, I notice that there is a 401.shmtl that redirects to my 401.php, is this really needed?

Falcon1986
02-21-2010, 06:19 PM
The .shtml pages that you see in your directories are generic error documents that should be safe to delete if you have created custom error documents.

As for seeing the source code of the protected page: Is this when your 401.php error document is handing the 401 error? Sounds like there may be something that needs modifying in the PHP source for that document.

sarlee
02-21-2010, 07:00 PM
OK - well, ErrorDocument must be specified in the default httpd.conf file as a shtml. If I delete the shtml I get the default apache message. I put a ErrorDocument directive in my .htaccess file pointing to my php document and that part works. I still see the source for my protected page when I get the 401 error. Also, the url in the browser bar shows the subdirectory which screws my navigation. You can see what I mean here:

www.leesburgsign.com/clients.php

Pick a client, keep hitting cancel for the password and when you get the 401 error right click and "view page source". This is with the latest version of firefox.
Actually, pick "vectronix" the others don't have code yet.

shadmego
02-21-2010, 08:22 PM
It looks like the path changed when you clicked on the link (actually either link takes you to the same error page).

If you want the template of your site to show in your error pages you will have to modify both the links to your css file and the links to your images.