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.config
file 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
SAMEORIGIN
instead ofDENY
:xml<add name="X-Frame-Options" value="SAMEORIGIN" />
Save the
web.config
file and restart IIS (if necessary) to apply the changes.
Comments
Post a Comment