Interesting 403 issue.
Interesting 403 issue.
I have setup a .htaccess file for my website and symlinked to it from my scriptalias directory. Now when I ban my ip address and access the main page I get a 403 but I also get a 404 document not found when trying to show one of my custom error pages. When I try and access any script in my script alias directory I get the proper error page.
I looked in my log files and saw that when I access the main page, apache looks for a "noindex.html" file saying that it can not find an index page? Of course I did not have one in my custom error file directory so I got the 404 error. Why would this happen when I try and access the index file on the docroot and not when I access any script in my script alias dir?
I know the redirect to the custom error files work properly, I just do n ot know why apache thinks there is noindex file when I try to access the docroot and not the script alias.
I looked in my log files and saw that when I access the main page, apache looks for a "noindex.html" file saying that it can not find an index page? Of course I did not have one in my custom error file directory so I got the 404 error. Why would this happen when I try and access the index file on the docroot and not when I access any script in my script alias dir?
I know the redirect to the custom error files work properly, I just do n ot know why apache thinks there is noindex file when I try to access the docroot and not the script alias.
Sure,
with my ip address banned, when I access the main website page it does restrict my access because of the ban and tries to show the 403 error page. The error page it tries to show is "noindex.html" which is weird because I have the 403 error showing a page called 403.html.
When I access any other part of the site (not the main index page) I still get banned but nowe I see the proper 403.html page. I just want to know why apache tries to show the noindex.html page when I try and access the main page of the site but shows the proper error page when I access any other part of the site.
with my ip address banned, when I access the main website page it does restrict my access because of the ban and tries to show the 403 error page. The error page it tries to show is "noindex.html" which is weird because I have the 403 error showing a page called 403.html.
When I access any other part of the site (not the main index page) I still get banned but nowe I see the proper 403.html page. I just want to know why apache tries to show the noindex.html page when I try and access the main page of the site but shows the proper error page when I access any other part of the site.
That's the entire point of the 403 error message and associated 403 error page (of which custom error pages can be defined in the apache config). The default 403 error page in my Apache config is "/error/noindex.html":moto526 wrote:Maybe that is the default page the server sends to banned IP's. That way you can make that the noindex.html page say what you want so the banned member can see they are banned.
http://voidmain.is-a-geek.net/error/noindex.html
This is defined in /etc/httpd/conf.d/welcome.conf:
Code: Select all
#
# This configuration file enables the default "Welcome"
# page if there is no default index page present for
# the root URL. To disable the Welcome page, comment
# out all the lines below.
#
<LocationMatch "^/+$">
Options -Indexes
ErrorDocument 403 /error/noindex.html
</LocationMatch>