Membership is FREE, giving all registered users unlimited access to every Acorn Domains feature, resource, and tool! Optional membership upgrades unlock exclusive benefits like profile signatures with links, banner placements, appearances in the weekly newsletter, and much more - customized to your membership level!

Web site access only via another web site first

Status
Not open for further replies.
Joined
Dec 30, 2006
Posts
1,749
Reaction score
76
Two web sites, Site-A & Site-B.

Does anyone know a way to ensure that access to Site-A is only possible via Site B? I'm thinking this may be a combination of htaccess and robots files here, but i need advice on the best way to do it.

Cheers!
 
place this in the header of site B:

<?php
if(!eregi('sitea\.co.uk', $HTTP_REFERER)){
die("You don't have access to this site");
}
?>
 
place this in the header of site B:

<?php
if(!eregi('sitea\.co.uk', $HTTP_REFERER)){
die("You don't have access to this site");
}
?>

That will work, although on PHP installations with register globals off (which will be most) you'll need to use $_SERVER["HTTP_REFERER"]

However, HTTP_REFERER is very easily spoofed, so this isn't suitable if you require any sort of security or certainty.
 
You could do it with an ACL as previously suggested. A two (or more) part key such as [ip address + session id], [http referrer + ip address], [etc...] should be enough to complete the task.

Alternatively you could issue a single use URL to the resource on server b and expire the link [token] after it has been clicked 1..* times and/or after a set time period has elapsed.

Code:
e.g http://www.server-b.tld/resource?token=6332757058575

In this use case you don't care where the user came from only that the resource is constrained by the business rules associated with the token.
 
Status
Not open for further replies.

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Members online

Premium Members

New Threads

Domain Forum Friends

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
      There are no messages in the current room.
      Top Bottom