PDA

View Full Version : .htaccess in subdirectories


sheila
04-13-2001, 01:23 PM
Serving custom error documents on IRM's has been tricky for me.

I have an IRM www.k12groups.org (http://www.k12groups.org) which maps to
http://www.thinkspot.net/k12groups/

In the k12groups subdirectory, I'm managing to serve custom 404 and 403 documents, and my .htaccess file says (in part), this:


ErrorDocument 404 /cgi-bin/Ri404/k12404.cgi
ErrorDocument 403 http://www.k12groups.org/403.html


The 404 is served out of the cgi-bin, so that directory, when accessed as k12groups.org, sees that as the root and it seems to work properly.

In order to get the 403 document served correctly, I had to give the full URL to the document.

HTH

Mandi
04-13-2001, 02:22 PM
It's not an IRM, it's strictly a subdirectory . . . but the full URL thing did the trick![nbsp][nbsp]That actually did occur to me, but I discarded the idea thinking that .htaccess could only read paths, not URL's - now I know!

Thanks, Sheila :)!

Mandi
04-14-2001, 12:54 AM
I run a subdirectory that is "hosted" at my site, but is in effect its own entitiy:[nbsp][nbsp]http://www.cgspouses.net/clubs/ .[nbsp][nbsp]I decided to give that section custom 404 and 403 pages.[nbsp][nbsp]I am having a heck of time getting .htaccess to point to those pages, which are located at http://www.cgspouses.net/clubs/errors/not_found.shtml and http://www.cgspouses.net/clubs/errors/not_allowed.shtml .

.htaccess says:

ErrorDocument 403 /errors/not_allowed.shtml
ErrorDocument 404 /errors/not_found.shtml

Options -Indexes
Test on these pages:[nbsp][nbsp]http://www.cgspouses.net/clubs/images/ for 403 and http://www.cgspouses.net/clubs/baloney.shtml for 404

This gives me my regular error documents, from the main www directory - not the specialized handling I'm looking for in that subdirectory.

*****

Using no / before "errors" (which would be appropriate in terms of the path) yeilds a standard apache error document, and additional 500 ISE in trying to handle the

Placing the error documents in the main /clubs/ directory and changing .htaccess to call it as /not_allowed.shtml yields a standard apache error page w/ additional 404

I feel I must be overlooking something very basic . . . I have a reverse impression of my keyboard on my forehead at the moment though . . .[nbsp]