Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > Linux
|
Linux General discussion of programming the various flavors of Linux operating systems.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Linux section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 16th, 2004, 12:58 PM
Registered User
 
Join Date: Mar 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default htaccess: restrict by http_referer AND domain

I am an htaccess newbie, please help! Even the tutorials are too difficult for me to understand.

I am webmaster of an Air Force site. We are trying to move our users away from the site I maintain and encouraging them to use our new Portal. I'd like to restrict users from viewing my web site unless they are coming from an Air Force Portal URL. At the same time, I do not want to closeout access to those users outside the Air Force who need access but cannot get access through the Air Force Portal. Hope this makes sense.

So in English it would be:

Allow "https://www.afportal.mil" (referring URL)
Allow army.mil (domain)
Allow navy.mil (domain)
Allow .gov (domain)
Deny af.mil AND redirect to "https://www.afportal.mil"
Deny .com AND redirect to "http://www.afpublic.com/"

Could you help me to translate this into real code PLEASE!?
 
Old March 27th, 2004, 01:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, people don't actually come _from_ a URL, surely (unless you mean the HTTP_REFERRER, which is, in itself, data which is notoriously unreliable).

If you mean that you want to be able to prevent access to people based on where they are, by trying to identify the IP address of their machines, for instance, then that too is prone to problems such as deliberate (or indeed, incidental and unintentional) masquerading).

On the whole, wouldn't it b easier to put a password protction on your site and distribute the password to people you wanted to give legitimate access to? After all, it's the people, not the machines, who you want to block or allow, isn't it?
 
Old December 3rd, 2004, 01:10 AM
Authorized User
 
Join Date: Dec 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I'm having a similar problem,
and am hoping someone can help.

I have a login page for my website,
the problem is that when my users login,
there's nothing stopping them from bookmarking
the page they logged into. Now when it comes to the
other pages on my site. they're sort of protected by
the frame that I inserted into my actual homepage, keeping
in mind that it's just classmates I want to restrict, so the
need for fort-nox is not needed. But I really want to make the
homepage accessible by a referral site (login page) only. If anyone
knows of all, or any means (easiest way hopefully) on how to do this,
it will be greatly appreciated.

Thanks.

Holmes
 
Old December 5th, 2004, 03:38 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default


http://p2p.wrox.com/topic.asp?TOPIC_ID=22966

Cheers :)

vinod





Similar Threads
Thread Thread Starter Forum Replies Last Post
Same pages for sub domain from main domain vivek_inos ASP.NET 1.0 and 1.1 Professional 1 February 13th, 2007 10:15 AM
<%=Request.ServerVariables("HTTP_REFERER")%> t400 Classic ASP Basics 0 June 30th, 2006 07:26 AM
HTTP_REFERER p2pMember Classic ASP Basics 5 March 14th, 2006 10:54 PM
HTTP_REFERER Tester Sometimes Redirects OK Visitor markw707 Classic ASP Basics 4 August 21st, 2003 11:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.