Via .htaccess I want to allow access to a specific .php file only if accessed from a specific page on my domain.
What code would you use in .htaccess to do that?
Via .htaccess I want to allow access to a specific .php file only if accessed from a specific page on my domain.
What code would you use in .htaccess to do that?
Well, you could try something like this:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://example.com/allowed/page/url$
RewriteRule restricted\/page\.php - [NC,F]
Be reminded that the referrer in any HTTP request can be tricked easily.