Y
Y
Ysery2020-08-09 10:41:38
htaccess
Ysery, 2020-08-09 10:41:38

Register Header in .htaccess only for the main domain, excluding the subdomain?

Good day.

Litespeed server.

Having registered such a line Header always set X-Frame-Options "SAMEORIGIN"for the main domain, it is also displayed on the subdomain, which I want to avoid. How can I do that? I tried to upload the .htaccess file to the folder with the subdomain, but I was told that such a file exists (its date and size are the same as what is in the root of the main site). It turns out that .htaccess is broadcast from the main site.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2020-08-09
@shambler81

htaccess

<IfModule headers_module>
Header set X-Frame-Options: SAMEORIGIN
</IfModule>

and also do not forget that you can enter it in the config of the site itself and not in httpd.conf, then it will only apply to the site you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question