How to Fix Missing Security Headers When CDN Overrides .htaccess Rules

This topic has 3 replies, 2 voices, and was last updated 1 weeks, 4 days ago ago by Andrew Mitchell

  • Avatar: khurram virk
    khurram virk
    Participant
    November 21, 2025 at 14:43

    Dear Sir,

    Good day to you.

    I am experiencing an issue related to missing security headers on my website that was detected when running a crawl using Screaming Frog. The screenshot is attached below:

    📸 Screenshot: https://snipboard.io/fh4ZaC.jpg

    In order to resolve these warnings, I added the following security headers to my .htaccess file:

    <IfModule mod_headers.c>
        # Force Security Headers on Everything including Images
        <FilesMatch ".(php|html|htm|rtf|rtx|txt|xsd|xsl|xml|css|js|json|rss|atom|jpg|jpeg|png|gif|webp|avif|svg|ico|otf|ttf|woff|woff2)$">
            Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
            Header always set X-Frame-Options "SAMEORIGIN"
            Header always set X-Content-Type-Options "nosniff"
            Header always set Content-Security-Policy "upgrade-insecure-requests;"
            Header always set Referrer-Policy "strict-origin-when-cross-origin"
            Header always set Permissions-Policy "geolocation=(), microphone=(), camera=()"
        </FilesMatch>
    </IfModule>

    However, even after applying the code, Screaming Frog still reports the same five issues. For testing, I switched Hostinger CDN to Development Mode, and all issues were solved. Once I turned the CDN back ON, the security header issues returned.

    Hostinger support informed me that custom headers cannot be applied while using their CDN and recommended using Cloudflare or another third-party service to manage custom security headers.

    I would like to ask:

    Is there any configuration within XStore or theme options that affects security headers while using CDN?

    Do you have any recommended method to apply custom security headers while keeping CDN enabled?

    Does XStore override or modify default header behavior in any way?

    Your guidance will be very helpful.

    Thank you.

    2 Answers
    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    November 21, 2025 at 15:18

    Hello, khurram virk

    To ensure you get the best support, we’re escalating your request to another specialist from our team, who will take a closer look at the issue.

    They will update you as soon as possible, and we’ll make sure to keep you posted. If you have any additional details that might help, feel free to reply here.

    Thank you for your cooperation!

    Best Regards,
    The 8Theme Team

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    November 21, 2025 at 17:45

    Hello, khurram,

    Your website and the XStore theme cannot influence security headers, as these are configured exclusively at the server or CDN level. You have correctly added the security headers in the .htaccess file, and they all function properly without the CDN, as confirmed by Screaming Frog. However, when the Hostinger CDN is enabled, it acts as an intermediary server that either blocks or rewrites these headers. As a result, browsers and scanners receive responses from the CDN rather than your server, and your custom headers are no longer present.

    To ensure proper functionality, the security headers must be configured directly within the CDN, or you may consider switching to a CDN that allows adding custom HTTP headers (for example, Cloudflare). This is a technical limitation of the CDN and is not related to the XStore theme.

    Best regards,
    8Theme’s Team

  • Viewing 3 results - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.