An Apache module which provides directives to control and modify HTTP request and response headers.
Questions tagged [mod-headers]
109 questions
1
vote
0 answers
Setting host header based on rewrite condition with apache and php-fpm
Situation: I am running a server with Apache 2.2 and PHP-FPM (mod_fastcgi, PHP 5.4.37). I need to internally rewrite a complete URL like http://dev2.example.com/at/en to http://dev2-at.example.com/en. Both ServerAliases are running on the same vhost…

MaC
- 11
- 4
1
vote
1 answer
replace comma characters on cookie value
I'm moving a webapp from .NET to Java platform and I have to deal with a legacy malformed cookie. I need to read a cookie with comma-separated value, and as explained in this other question it's not valid. When I try to read from HttpServletRequest…

rgb
- 31
- 4
1
vote
2 answers
What's the opposite of "Header append Vary User-Agent", how to remove the "User-Agent" string from "Vary"?
I know that I can add the User-Agent to the Vary http header with this line in my .htacess:
Header append Vary User-Agent
But how can I remove the User-Agent from the Vary header if it is already set?
According to the mod_headers doc there is an…

nachtigall
- 2,447
- 2
- 27
- 35
1
vote
1 answer
Removing duplicate headers from HTTP requests
I am using an Apache 2.4 server with mod_proxy as an HTTP reverse proxy for Tomcat server. The reverse proxy works on a Split-DNS configuration where "server.com" might point either to the actual HTTP server or to my reverse proxy depending on where…
user4118620
1
vote
1 answer
Can mod_headers change headers generated by uWSGI?
I have a uWSGI service running behing an apache front-end. The part of my apache conf handling that lools like:
SetHandler uwsgi-handler
uWSGISocket /var/run/uwsgi/myapp.sock
Allow from all
…

Pierre-Antoine
- 1,915
- 16
- 25
1
vote
1 answer
How to do .htaccess redirect and HTTP cache for static images in a no-cookie subdomain
We want to do redirects for our site photos from domain.com/images/ to a no-cookie img.domain.com.
Currently, we have images directory in public_html, URLs are:…

1453939
- 242
- 5
- 14
1
vote
1 answer
backwards or forwards slash in files match .htaccess
I'm unsure whether the following is correct considering I can't find a web example that targets a file inside a directory.
Header set X-Robots-Tag "noindex, nofollow"
is it ok that way or:

lbennet
- 1,083
- 5
- 14
- 31
1
vote
1 answer
Setting P3P headers in Apache causes Internal Server Error
I wanted to set the P3P Headers by adding them to .htaccess using the following:
Header set P3P "CP="ALL DSP COR CUR ADM TAI OUR IND COM NAV INT""
However, this causes an Internal Server Error. The only related…

AnuragBabaresco
- 604
- 8
- 19
1
vote
2 answers
apache mod_headers Date: Header
Folks,
Need to convert the following request header to a different format:
RequestHeader set Date "%{TIME_WDAY}e"
The %t variable looks like :
t=1367272677754275
Would like the Date= to look like:
Date: Tue, 27 Mar 2007 19:44:46 +0000
How is…

Cmag
- 14,946
- 25
- 89
- 140
1
vote
1 answer
Automatically download files in specified folder regardless of type
How can I make it so that when a user visits a file in a specified folder, I can force the file to be downloaded?
I know it's possible to do this type by type using .htaccess and you can force a file to download using a php script, but how can I…

Max Hudson
- 9,961
- 14
- 57
- 107
0
votes
2 answers
How to add Customizable header in Adobe Experience Manager as a Cloud Service In dispatcher
i want to add custom header in dispatcher configuration in Adobe Experience Manager as a Cloud Service I m adding this configuration
Header set X-XSS-Protection "1; mode=block"
when i m deploying the changes its not getting visible on dev…

Danish Shaikh
- 1
- 2
0
votes
0 answers
Header set Access-Control-Allow-Origin code added but nothing is happening
I am trying to solve the below option on my website
Strict-Transport-Security
Content-Security-Policy
X-Frame-Options
X-Content-Type-Options
Referrer-Policy
Permissions-Policy
I found the below code on Google and added the same in…

Naren Verma
- 2,205
- 5
- 38
- 95
0
votes
0 answers
How do I edit a response header in Apache HTTP Server before it is returned to the client?
I have an Apache Server that acts both as a proxy and as a reverse proxy for various BE services.
One of these services - to which I do not have access - returns a response with a Location Header that I would like to change.
I can easily log this…

arun_dev
- 11
- 1
0
votes
0 answers
Passing system variable to Apache stopped working
We rebooted one of our servers over the weekend and now Apache won't pass through the host name - not sure whats wrong. Here's my config:
LoadModule headers_module modules/mod_headers.so
LoadModule …
user4654707
0
votes
0 answers
How to set url filter in mod-header
I am trying to edit request headers and using modheader chrome extension. I use the following code, the question is how to set 'filters: []' here:
page.visit("chrome-extension://idgpnmonknjnojddfkpgkljpfnnfcklj/_generated_background_page.html")
…

anna
- 1
- 1