Hello,
I've been discussing htaccess over in the Apache forum, but it appears my htaccess file is not working properly because of some php custom error pages.
I have an oscommerce website using php files. The index.php file is in the public folder, but it only points to a different index.php file in a different directory. So, there is a header( 'Location code in that first index.php file and also in both the 403.php and 404.php error files in the same directory.
My htaccess file is supposed to be causing 403 error messages for my allow/deny directives and my block certain referrers and certain user agents directives, but instead it is causing 301 redirects back to the home page or 500s.
I don't think there is a problem having the index.php in the public folder pointing to the other one. But I don't understand why the error pages are doing the same thing. I can't remove those error pages without causing my site to stop working and giving a can't find errordocument message. This is in the htaccess file:
Options All -Indexes
ErrorDocument 403 /403.php
ErrorDocument 404 /404.php
I don't think I can remove them, but what can I put in them that won't cause my htaccess to make my directives give the wrong messages.
I tried creating two different htaccess files. One in the root with the blocking directives and the other one in the public folder with just the ErrorDocument message, some redirects from my old site to my new one (just moved this month) and another directive that I believe is supposed to fix those unreadable URLs to readable ones.
So, now I am getting some 403s, but only when the unwanted visitor goes to the home directory. If they come in from old URLs, then they either get the 301 redirect or a 500.
What should those custom error pages have in them? At the moment they have the header( 'Location code, which I believe is a redirect to the home page. I just want the normal server error responses, not the redirects.
I hope this makes sense. Thank you for any suggestions.