Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

Web site access only via another web site first

Status
Not open for further replies.
Joined
Dec 30, 2006
Posts
1,749
Reaction score
75
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.

Rule #1: Be Respectful

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

Premium Members

New Threads

Domain Forum Friends

Lastest Listings

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Siusaidh AcornBot:
    Siusaidh has left the room.
      Siusaidh AcornBot: Siusaidh has left the room.
      Top Bottom