I have the following in my .htaccess file:
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" "expr=%{HTTPS} == 'on'"
Header always set X-XSS-Protection "0; mode=block"
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
Header always set Expect-CT "max-age=7776000, enforce"
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET,PUT,POST,DELETE"
Header set Access-Control-Allow-Headers "Content-Type, Authorization"
Header set X-Content-Security-Policy "img-src *; media-src * data:;"
Header always set Content-Security-Policy "report-uri https://mydomain.com"
Header always set X-Frame-Options "SAMEORIGIN"
Header always set Permissions-Policy "accelerometer=(), autoplay=(), camera=(), fullscreen=*, geolocation=(self), gyroscope=(), microphone=(), payment=*"
Header set X-Permitted-Cross-Domain-Policies "none"
</IfModule>
My error log shows this:
2023-04-14 06:12:44.498247 [INFO] [33912] Rewrite directive: <IfModule mod_headers.c> bypassed.
2023-04-14 06:12:44.498250 [INFO] [33912] Invalid rewrite directive: Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" "expr=%{HTTPS} == 'on'"
2023-04-14 06:12:44.498254 [INFO] [33912] Invalid rewrite directive: Header always set X-XSS-Protection "0; mode=block"
2023-04-14 06:12:44.498258 [INFO] [33912] Invalid rewrite directive: Header always set X-Content-Type-Options "nosniff"
2023-04-14 06:12:44.498261 [INFO] [33912] Invalid rewrite directive: Header always set Referrer-Policy "strict-origin-when-cross-origin"
2023-04-14 06:12:44.498264 [INFO] [33912] Invalid rewrite directive: Header always set Expect-CT "max-age=7776000, enforce"
2023-04-14 06:12:44.498268 [INFO] [33912] Invalid rewrite directive: Header set Access-Control-Allow-Origin "*"
2023-04-14 06:12:44.498271 [INFO] [33912] Invalid rewrite directive: Header set Access-Control-Allow-Methods "GET,PUT,POST,DELETE"
2023-04-14 06:12:44.498275 [INFO] [33912] Invalid rewrite directive: Header set Access-Control-Allow-Headers "Content-Type, Authorization"
2023-04-14 06:12:44.498279 [INFO] [33912] Invalid rewrite directive: Header set X-Content-Security-Policy "img-src *; media-src * data:;"
2023-04-14 06:12:44.498282 [INFO] [33912] Invalid rewrite directive: Header always set Content-Security-Policy "report-uri https://christ4.me"
2023-04-14 06:12:44.498285 [INFO] [33912] Invalid rewrite directive: Header always set X-Frame-Options "SAMEORIGIN"
2023-04-14 06:12:44.498289 [INFO] [33912] Invalid rewrite directive: Header always set Permissions-Policy "accelerometer=(), autoplay=(), camera=(), fullscreen=*, geolocation=(self), gyroscope=(), microphone=(), payment=*"
2023-04-14 06:12:44.498293 [INFO] [33912] Invalid rewrite directive: Header set X-Permitted-Cross-Domain-Policies "none"
2023-04-14 06:12:44.498296 [INFO] [33912] Rewrite directive: </IfModule> bypassed.
It all seems to be working fine but why does it show the errors in the log?
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" "expr=%{HTTPS} == 'on'"
Header always set X-XSS-Protection "0; mode=block"
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
Header always set Expect-CT "max-age=7776000, enforce"
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET,PUT,POST,DELETE"
Header set Access-Control-Allow-Headers "Content-Type, Authorization"
Header set X-Content-Security-Policy "img-src *; media-src * data:;"
Header always set Content-Security-Policy "report-uri https://mydomain.com"
Header always set X-Frame-Options "SAMEORIGIN"
Header always set Permissions-Policy "accelerometer=(), autoplay=(), camera=(), fullscreen=*, geolocation=(self), gyroscope=(), microphone=(), payment=*"
Header set X-Permitted-Cross-Domain-Policies "none"
</IfModule>
My error log shows this:
2023-04-14 06:12:44.498247 [INFO] [33912] Rewrite directive: <IfModule mod_headers.c> bypassed.
2023-04-14 06:12:44.498250 [INFO] [33912] Invalid rewrite directive: Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" "expr=%{HTTPS} == 'on'"
2023-04-14 06:12:44.498254 [INFO] [33912] Invalid rewrite directive: Header always set X-XSS-Protection "0; mode=block"
2023-04-14 06:12:44.498258 [INFO] [33912] Invalid rewrite directive: Header always set X-Content-Type-Options "nosniff"
2023-04-14 06:12:44.498261 [INFO] [33912] Invalid rewrite directive: Header always set Referrer-Policy "strict-origin-when-cross-origin"
2023-04-14 06:12:44.498264 [INFO] [33912] Invalid rewrite directive: Header always set Expect-CT "max-age=7776000, enforce"
2023-04-14 06:12:44.498268 [INFO] [33912] Invalid rewrite directive: Header set Access-Control-Allow-Origin "*"
2023-04-14 06:12:44.498271 [INFO] [33912] Invalid rewrite directive: Header set Access-Control-Allow-Methods "GET,PUT,POST,DELETE"
2023-04-14 06:12:44.498275 [INFO] [33912] Invalid rewrite directive: Header set Access-Control-Allow-Headers "Content-Type, Authorization"
2023-04-14 06:12:44.498279 [INFO] [33912] Invalid rewrite directive: Header set X-Content-Security-Policy "img-src *; media-src * data:;"
2023-04-14 06:12:44.498282 [INFO] [33912] Invalid rewrite directive: Header always set Content-Security-Policy "report-uri https://christ4.me"
2023-04-14 06:12:44.498285 [INFO] [33912] Invalid rewrite directive: Header always set X-Frame-Options "SAMEORIGIN"
2023-04-14 06:12:44.498289 [INFO] [33912] Invalid rewrite directive: Header always set Permissions-Policy "accelerometer=(), autoplay=(), camera=(), fullscreen=*, geolocation=(self), gyroscope=(), microphone=(), payment=*"
2023-04-14 06:12:44.498293 [INFO] [33912] Invalid rewrite directive: Header set X-Permitted-Cross-Domain-Policies "none"
2023-04-14 06:12:44.498296 [INFO] [33912] Rewrite directive: </IfModule> bypassed.
It all seems to be working fine but why does it show the errors in the log?