Re: IP restricted site
Harlan Messinger wrote:
[color=blue]
> "xman" <imiller@bsd.uchicago.edu> wrote:
>[color=green]
>>I would like to have a home page the will display
>>a stop light with a red or green light if you are viewing the page from
>>the allowed network ( green light )
>>not on the allowed network
>>( red light )
>> I will do the lock down in apache.
>>
>>Is there any examples on how this could be done ( sample code)
>>( I will work on the stop light image ) I just need the html logic.[/color][/color]
<sig-bait>There's no logic in HTML.</sig-bait>
Seriously, HTML doesn't _do_ stuff, there aren't conditionals. It just
describes data.
[color=blue][color=green]
>>has to work on IE 6 and netscape 6.0 <
>>any examples or places to look would be great.[/color]
>
> This is more of a CGI question than an HMTL one. The answer will
> depend on what server-side programming language you're using, but it
> involves reading the REMOTE_ADDR value sent with the request in the
> HTTP headers.[/color]
He said he's using Apache to turn people away; there's no need for a script
to be checking the IP address. Just use Apache's error handler.
<URL:http://httpd.apache.org/docs-2.0/mod/core.html#errordocument>
Basically, just plonk down a file at /errors/401.html and put the following
in .htaccess:
ErrorDocument 401 /errors/401.html
Obviously, you have to allow everyone to access the error document.
--
Jim Dabell |