deny access to a php file.

  • oskillzzo
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jul 04, 2008
  • Posts: 50
  • Status: Offline

Post June 20th, 2009, 12:09 am

is there a script to deny access to a file from other sites using it? or something like if its not a certain domain, some other content shows up instead of the original file?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 20th, 2009, 12:09 am

  • casablanca
  • Proficient
  • Proficient
  • User avatar
  • Joined: May 29, 2007
  • Posts: 481
  • Status: Offline

Post June 20th, 2009, 3:36 am

You can't deny access to a webpage as such, but if it's some content that is referred to in the page like an image, you can use the HTTP referrer to detect and block access from other domains.
No Strings Attached: A JavaScript graphics demo.
  • oskillzzo
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jul 04, 2008
  • Posts: 50
  • Status: Offline

Post June 20th, 2009, 9:45 am

its a php file that im trying to block access to. so theres no way to give false information for people accessing it outside the domain?
  • Rider
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jun 19, 2009
  • Posts: 7
  • Status: Offline

Post June 22nd, 2009, 5:23 pm

casablanca wrote:
You can't deny access to a webpage as such, but if it's some content that is referred to in the page like an image, you can use the HTTP referrer to detect and block access from other domains.

Did you read this? You can detect and block access from other domains.
Also you can use a .htaccess file if it is in a separate folder from the rest of your site and deny all outside domains.
Rider
  • kapalpecah
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jun 25, 2009
  • Posts: 13
  • Status: Offline

Post June 25th, 2009, 9:34 pm

You can try create .htaccess :

RewriteCond %{HTTP_HOST} ^domain_to_be_redirected\.com

put this on folder where php file you want to protect

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 160 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.