How to prevent other sites from hijacking your website and displaying it on their website.
Ever wonder where your bandwidth is going? Sometimes, it is used without your knowledge.
High bandwidth usage can happen when another website hijacks your website.
[How?]
This is where the hijacker takes your URL and embeds it within an iframe
Copy
Search Site
Search Google
.
Hijacking a website allows them to load your website onto theirs without your knowledge. (This happens more than you know.)
To combat this issue. Depending on your Server Infrastructure, choose one of the methods below.
[IIS Server | web.config - customHeaders]
CFFCS | CarrzSynEdit: | ASP.NET (VB/C#)

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
	<system.webServer>
	   <httpProtocol>
          <customHeaders>
<!--This line will make it so other sites cannot hijack our site through an iframe.-->
	      <add name="X-Frame-Options" value="sameorigin" />
          </customHeaders>
       </httpProtocol>
    </system.webServer>
</configuration>

[.htaccess]
CFFCS | CarrzSynEdit: | HTML (Hyper Text Markup Language)
Header append X-Frame-Options: "SAMEORIGIN"

Enable on Apache
[Apache configuration][Debian]: /etc/apache2/conf-enabled/security.conf
Copy
Search Site
Search Google

[Redhat]: /etc/httpd/conf/httpd.conf
Copy
Search Site
Search Google
[Apache]
CFFCS | CarrzSynEdit: | HTML (Hyper Text Markup Language)
Header set X-Frame-Options: "SAMEORIGIN"  #Allow for Same Origin (Default Action)
Header set X-Frame-Options: "ALLOW-FROM http://example.com/" #Allow from specific origin
Header set X-Frame-Options: "DENY" #Deny to everyone

[Nginx]
To enable the X-Frame-Options header on [Nginx], add it to your server block config
[Nginx]
CFFCS | CarrzSynEdit: | HTML (Hyper Text Markup Language)
add_header X-Frame-Options "sameorigin" always;

For more information on this, please have a look at the following page.
X-Frame-Options - How to Combat Clickjacking | (keycdn.com)«