R
R
rubtsoff2016-06-27 21:17:54
Apache HTTP Server
rubtsoff, 2016-06-27 21:17:54

How to give page access through .htaccess only through iframe?

I found the code itself, but it is necessary that the page be accessed only through the iframe
and the page itself is file.php, which I changed into
RewriteRule ^file/([^/]*)$ /file.php?id=$1 [L]
i.e. the file site. com/file.php?id=3-> site.com/3
and there should be access only via iframe
here is the code that does this but you need to glue them somehow
RewriteCond %{HTTP_REFERER} !site.com
RewriteCond %{REQUEST_URI} ^/ path/to/protected/page$
RewriteRule . -[F]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2016-06-27
@shambler81

Header always append X-Frame-Options DENY

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question