Prevent Click-jacking
Edit the web.config file (Optional)
You can also add the header directly by modifying the web.config file of your website:
Open the
web.configfile located in your site's root directory.Add the following code within the
<system.webServer>section:xml<system.webServer> <httpProtocol> <customHeaders> <add name="X-Frame-Options" value="DENY" /> </customHeaders> </httpProtocol> </system.webServer>If you want to allow framing only within the same origin, use
SAMEORIGINinstead ofDENY:xml<add name="X-Frame-Options" value="SAMEORIGIN" />Save the
web.configfile and restart IIS (if necessary) to apply the changes.
Comments
Post a Comment