deny access to a php file.

  • oskillzzo
  • Beginner
  • Beginner
  • oskillzzo
  • Posts: 50

Post 3+ Months Ago

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?
  • casablanca
  • Proficient
  • Proficient
  • User avatar
  • Posts: 481

Post 3+ Months Ago

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.
  • oskillzzo
  • Beginner
  • Beginner
  • oskillzzo
  • Posts: 50

Post 3+ Months Ago

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
  • Rider
  • Posts: 7

Post 3+ Months Ago

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
  • kapalpecah
  • Posts: 13

Post 3+ Months Ago

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 77 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.