Jump to content


block referrer URL from my domain

  • Please log in to reply
3 replies to this topic

#1 ge3k

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 17 April 2006 - 05:09 PM

I have two domain names points to an IP address
domain1.com and configured with A resource record and
domain2.com and configured with cname resource record and points to domain1.com

I want a folder on the server to only be opened with domain2.com cant be opened with domain1.com

for exmaple
I want vistors from "domain1.com/folder" see not found message.
and vistors from "domain2.com/folder" see the files in that folder.

I tried to configure .htaccess file and and put it in "/folder"
<Limit GET>
order deny,allow
deny from .domain1.com
allow from .domain2.com
but nothing happened.

Is there a soultion using "HTTP_REFERER".
please help?

#2 GingerRobot

  • Staff Alumni
  • Advanced Member
  • 4,086 posts
  • LocationUK

Posted 17 April 2006 - 07:32 PM

There wont be a definitave solution using http referrer - some firewalls do not allow the referrer to be sent and some browers can be configured not to send them.

#3 poirot

  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 17 April 2006 - 11:19 PM

Yep, it's simple... You can use regular expressions to check if the HTTP_REFERER is domain1.com and if it returns true you use die() or whatever...

But as GingerRobot said, it's not a very good idea since this header is not "trustworthy"
~ D Kuang

#4 ge3k

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 18 April 2006 - 02:44 PM

thanks gurus for help and suggetions
but could you give me a simple code to apply, I'm still noob.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users