httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jsl...@gmail.com>
Subject Re: [users@httpd] Question regarding VirtualHosts
Date Thu, 10 Nov 2005 20:46:07 GMT
On 11/10/05, Martin Lyberg <martin.lyberg@gmail.com> wrote:
> On 11/10/05, Joshua Slive wrote:
>
> > In this example:
> >
> http://httpd.apache.org/docs/1.3/misc/FAQ.html#canonical-hostnames
> >
> > Replace the Redirect with a
> > <Location />
> > Deny from all
> > </Location>
> >
>
> Hi Joshua,
>
> I'm not quite sure i understand the syntax. Where would i put this:
>
> <Location />
> Deny from all
> </Location>
>
>  Inside both of my VHosts? The sites are two different ones, and i don't
> want a user to access any of the sites if he types the ip directly. He must
> type the correct adress to access a site.

Hmmm... Did you read the FAQ entry?

Anyway, to be extremely explicit, keep the exact config you already
have but add the following immediately BEFORE the existing
<VirtualHost> sections.  This works because the first listed
name-based virtual host catches all non-matching hostnames.

<VirtualHost *:80>
ServerName ip.ip.ip.ip
<Location />
Order allow,deny
Deny from all
Satisfy all
</Location>
ErrorDocument 403 "There is no website here; go away."
</VirtualHost>

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message