Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Page access depending on referral site

Page access depending on referral site
Thread Tools
Junior Member
Join Date: Nov 2001
Location: England
Status: Offline
Reply With Quote
Mar 12, 2005, 05:35 AM
 
hi all,
Please help me.

I need to store files on one website and have then accessed from another domain/website. However I really don't want any other sites referring/linking to them.

Is there a way to setup an 'automatic' referral access code so that only a certain domain can access the files - otherwise you get an error.

My inspiration comes from the code you can place in a frame to make sure to opens in a frameset and I'm hoping there's something equalivent to solve this problem. I have access to the .htacess and .htpasswd files on my unix servers should that help.

I would really appricate any help,
cheers
     
Dedicated MacNNer
Join Date: Nov 2003
Location: SoCal
Status: Offline
Reply With Quote
Mar 13, 2005, 12:13 AM
 
well if you don't want crawlers or search engines to link to your site you can use a robots.txt file explained here

or if you're using php, you can parse the $_SERVER['PHP_REFERER'], and decide to show the page or forward to a UA page.
     
Mac Enthusiast
Join Date: Aug 2002
Location: Santa Rosa, CA
Status: Offline
Reply With Quote
Mar 13, 2005, 02:02 AM
 
Within your .htaccess file you can use mod_rewrite and mod_proxy to do your bidding, assuming they're present... and they probably are.

Many answers can be found on this page , but you will especially want to look at the section on URL-Restricted Proxy.

Basically, you create a text file that specified the domains that you want to allow to link to your content... and only http requests from those domains will be serviced.
     
Dedicated MacNNer
Join Date: Nov 2003
Location: SoCal
Status: Offline
Reply With Quote
Mar 13, 2005, 02:46 AM
 
eggman's suggestion is much better. thanks for the apache lesson.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:14 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2