[nzlug] 403 Errors - Virtual Hosts - Apache

Rob bubaphex at gmail.com
Wed Jul 16 11:16:22 NZST 2008


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.

cheers


More information about the NZLUG mailing list