LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache2 .htaccess and virtual hosts (https://www.linuxquestions.org/questions/linux-server-73/apache2-htaccess-and-virtual-hosts-639139/)

wacko_cracko 05-01-2008 10:19 AM

Apache2 .htaccess and virtual hosts
 
Hi All,

I have been configuring my apache server and ran across a few issues, the main httpd.conf is configured to allow .htaccess and AllowOverride is set to Limit and Indexes which is what i need.

The document root which is the same as the first virtual host my .htaccess access works perfectly, Allows in when supposed to and shows the forbidden page when you cant get in

I created a second virtualhost with a different documentroot and placed a .htaccess file and it stopped didnt work, I then went ahead and placed the following in the virtual host config

<Directory /var/www/vhosts/rhc>
Options Indexes FollowSymLinks
AllowOverride Limit Indexes
</Directory>

and it started to work but on failed requests instead of showing the forbidden page it takes me to the default nohtml page for CentOS

my question is really.

1. the config in the httpd.conf does this only apply to the documentroot it specifies?
2. Why does it go to the nohtml page rather than show you are forbidden from accessing this page.
3. Where is the document file which shows the forbidden page !?

Many thanks!!!

vtbludgeon 05-02-2008 08:31 AM

I am no expert, but.. is there a specific ErrorDocument 403 directive for the virtual host? Show us the .htaccess file in the virtual host's web doc root.

danboland 05-02-2008 11:17 AM

What could be happening is its trying to show the 403 error page, but can't find it so it ends up showing the other one, check the other apache config files for these settings.

Dan


All times are GMT -5. The time now is 09:37 PM.