Set up .htaccess file

A .htaccess file on the highest web server level, may contain this:

conditional-redirect-in-htaccess.txt

Also check our page about security headers.