[nzlug] 403 Errors - Virtual Hosts - Apache

Cliff Pratt enkidu at cliffp.com
Wed Jul 16 19:10:29 NZST 2008


Rob wrote:
> Hey all,
> 
> Tried searching for a solution to my problem but keep coming up with topics
> not relevant.
> 
> Im trying to set a file/directory for all 403 errors to go to in my virtual
> host.
> 
> Just wondering where im going wrong.
> 
> # mysite
> <VirtualHost 0.0.0.0:80>
> ServerName mysite.co.nz
> RewriteEngine on
> RewriteCond %{HTTP_HOST}   !^$
> RewriteRule ^/(.*)         http://www.mysite.co.nz/$1 [NE,R]
> </VirtualHost>
> 
> <VirtualHost 0.0.0.0:80>
>     ServerAdmin myemail at mysite.co.nz
>     DocumentRoot /var/www/html/mysite
>     ServerName www.mysite.co.nz
>     ErrorDocument 403 /var/www/html/mysite404/index.html
> </VirtualHost>
> 
> Basicly i have a .htaccess file with block all, and a list to allow.
> Currently it loads the Fedora test page but i was wanting it to load
> something alittle more friendly to explain why they cant see the site.
> 
Do you mean 403 - Forbidden, or 404 - Not found? Your error document 
line is ambiguous. 8-).

Cheers,

Cliff



More information about the NZLUG mailing list