Ok heres my problem. i have domain http://www.xxx.com i got php file http://www.xxx.com/1.php i got html file http://www.xxx.com/1.html www.xxx.com/1.php when loaded in the browser loads 1.html. now i dont want both these files to be accesed directly thru browser at and wen accesed to dispaly a error message. but i want 1.php to be only loaded from 1 certain external domain eg stormpay.com Is there a way i do that i can use hotlinking to block direct access to the files and redirect ti to an error page or back to main page. But how do i access the page from a certain domain? Can any1 help me?
htaccess? Deny the file '1.html' to be accessed by anyone, but allow the servers own IP address to access it. This will allow it to still be called through 1.php, but not accessed by anyone manually. .htaccess: <Files 1.html> Order deny,allow allow from [enter servers IP here] Deny from all </Files> Code (markup):
Put this on the php page. if (!eregi("stormpay.com", $_SERVER['HTTP_REFERER'])) { die ("You can't access this file directly..."); } Re's Rob Whisonant
You could also set in .htaccess to parse php in html files and add something similar to the html page so it only loads if called from a particular page. Re's Rob Whisonant