[nzlug] 403 Errors - Virtual Hosts - Apache

Cliff Pratt enkidu at cliffp.com
Wed Jul 16 21:05:54 NZST 2008


Is this any use?

http://www.webmasterworld.com/apache/3336025.htm

Cheers,

Cliff

Rob Anderson wrote:
> Yeah I mean 403 error
> 
> On 16/07/2008, at 7:10 PM, Cliff Pratt <enkidu at cliffp.com> wrote:
> 
>> 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-).
>>




More information about the NZLUG mailing list