LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   .htaccess issue - CentOS (https://www.linuxquestions.org/questions/linux-security-4/htaccess-issue-centos-468357/)

JDMs14 07-27-2006 05:36 PM

.htaccess issue - CentOS
 
Greetings all,


I've created an .htaccess file in the root of my web server (/var/www/html) to block 1 particular ip from accessing the site.

Here it is:

<Files .htaccess>
deny from all
</Files>
deny from ***.***.***.***

Fairly simple right? Everything works fine...i've tested it from that particular IP and the user couldnt access anything. For example: mysite.com/games or mysite.com/pics would return a 403 unauthorized page like it should.

My problem lies in that when the person visits www.mysite.com they don't get the 403 error page. They get the CentOS Apache test page. I'm totally dumbfounded as to what is causing this...can anyone shed some light?


Thanks!

timjowers 07-28-2006 10:00 AM

What is the error page in httpd.conf?
 
Quote:

Originally Posted by JDMs14
Greetings all,
I've created an .htaccess file in the root of my web server (/var/www/html) to block 1 particular ip from accessing the site.
Here it is:
<Files .htaccess>
deny from all
</Files>
deny from ***.***.***.***
...
Thanks!

Just a thought....
Can you access /etc/httpd/conf/httpd.conf? (s/httpd/apache/)
maybe an error page can be configured there. I'm not cognizant of an "htaccess deny" error page but haven't researched it.

pk21 07-29-2006 05:01 AM

Quote:

Originally Posted by JDMs14
My problem lies in that when the person visits www.mysite.com they don't get the 403 error page. They get the CentOS Apache test page. I'm totally dumbfounded as to what is causing this...can anyone shed some light?

Check your apache error log. Probably apache can't read your .htaccess file and is complaining about it.

29t88 09-15-2009 03:58 PM

If you still have this issue:
Make a custom 403 error page
add this to the .htaccess
ErrorDocument 403 /403.html
and have the contents of the error file in there.

win32sux 09-15-2009 04:20 PM

29t88, please don't bring dead threads back to life (necroposting). We value your time and energy, and encourage you to spend it helping members with current issues. I'm closing this zombie thread so it may rest in peace.


All times are GMT -5. The time now is 03:40 PM.