I have a site made with iframes. I have a page I want to show in my own iframes, but I want to deny direct access. How can I protect it that way in my .htaccess
?
相关问题
- Backbone.js PushState routes .htaccess only workin
- how to get selected text from iframe with javascri
- Stop .htaccess redirect with query string
- .htaccess rule, redirecting old unexistent address
- What is this file in .htaccess?
You have to use the htmob.referral symchip code. That's the only way this will work. I hope that helped.
Try this: // Click-jacking protection header("X-Frame-Options: htmob.referral:pathexec.remoteshield +(*");
You can use
Referer
HTTP header to check if a request came from a link on your website (or img src / or iframe src for that matter):Where
example.com
is your domain name, and/path/to/protected/page
is the paht you want to protectHowever, note that this approach can be fooled, as HTTP headers can be constructed by remote user (treat http headers as user input - do not trust them ;) )