Set header on a specific page with .htaccess

This should work for you in Apache 2.4+

<If "%{THE_REQUEST} =~ m#/glossary#">
    Header Set Test-Header "success"

Instead of == operator for string comparison, we are using =~ operator for regex matching here.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top