How do I go about allowing access to a webpage ONLY when referred by a specific domain? I have a successful checkout URL from paypal where people get a download, but I dont want them to be able to get to that page by just typing it in. Im assuming it possible in .htaccess, but can't seem to figure out how.
You can do it with .htaccess, but if the page they are trying to get to is PHP, it would be easier to do it within the PHP logic.
You could use this line to start with <?php if ( substr_count($_SERVER["HTTP_REFERER"],"url_of_referer")==1) { include ("path_to_download"); } else { include("your_error_page"); } ?> PHP:
"stristr" would require an exact match. "substr_count" can be made to ignore subdirectories and "?...."
Any way to have to load a cookie so users can access the direct page without needing to go through the gateway?