Ted Appleberry wrote:
> We have a corporate intranet which is available on the net, we have a sub
> domain stored elsewhere, we would only like people to be able to access that
> sub domain by clicking a link from the main intranet.. It does not have to
> be bulletproof by any means.. We just want to discourage direct linking.. If
> somebody were to fake from where they were originating and were to gain
> access to the site then so be it..If somebody werre to simply try and access
> the site directly they would receive an error message indicating they can
> only access the site by clicking the link from the intranet.
Ok, your expanded explanation better explains your circumstances.
However, readers need to know if your "intranet" means you are using
a Local Area Network (LAN) system. Use of a LAN system means
each machine on your network will have an easy-to-recognize machine
IP Address, such as 192.168.0.5 or 10.10 ... something. There are
many variations, but each machine should have an address "similar"
to all other machines, for a single LAN system.
Should this be your circumstance, then you can allow or deny based
on IP Address.
An example,
Your LAN network has three machines: 192.168.0.2 192.168.0.3 192.168.0.4
Your subdomain may or may not have a similiar address, which does not matter,
unless you have machines with variations of your subdomain IP Address.
For that case example you can use an entry in your httpd.conf file or use an
entry in an .htaccess file to control access.
Order Deny,Allow
Deny from all
Allow from 192.168
That syntax will deny access to all but allow access for any IP Address
which begins with 192.168 which will allow access by those three
machines in my example above.
That will also cover for a DHCP server which assigns IP Addresses
upon machine boot; a machine address will change but will always
be within a "block" of similar IP Addresses.
Research and read about Apache access control via allow and deny.
Google for: apache htaccess allow deny
You will discover hundreds of sources for study and examples.
Might help to reseach and read about LAN systems so you
can better understand how IP Addresses work within a LAN.
"...only access the site by clicking the link from the intranet."
Do not do that! The only way a referrer variable will work correctly
is if all your users are using the same browser, such as MSIE,
and all browsers are set to provide a referrer variable. This will
not stop a user from changing that behavior!
Restricting access by IP Address is virtually foolproof.
Restricting access by referrer variable will often make a fool of you.
There is a caveat. Machines on your LAN cannot have file sharing
enabled, else access could be gained through UNC (mapped drive)
type access or similar. This applies mostly to Windows machines.
Controlling access can be very challenging on a LAN system.
Give restricting IP Addresses a try. Might be just what you need.
Post more information if this does not help. Many readers will
afford you a variety of methods for your circumstances.
Purl Gurl
>> Stay informed about: Configuring .htaccess on Windows Platform