-1

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?

GingerGirl
  • 301
  • 1
  • 16

1 Answers1

1

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.

H. Evers
  • 78
  • 7