You can set headers conditionally if certain word present in the URL using .htaccess. This can be completed by using the Header directive and the "IF" conditional directive.

Below is the sample to conditionally set header
<If "%{THE_REQUEST} !~ m#s/+user[/?s]#">
 Header set X-Content-Type-Options nosniff
In the above sample, "X-Content-Type" will be set if the word "user" present in the URL.

Comments (0)
Leave a Comment

loader Posting your comment...