RewriteHeader does not work at all
3 posts
• Page 1 of 1
- TheRedDuke
- Posts: 2
- Joined: 16 Mar 2016, 15:50
RewriteHeader does not work at all
Hello,
I'm trying to use RewriteHeader to set some headers when loading a .png file.
To test this, I've set my entire .htaccess file to read as follows:
Absolutely nothing happens. This header is nowhere to be found.
I have also tried removing the quotation marks to have the rule read:
This also does nothing.
My end goal is to be able to set Cache-Control headers on images that are loaded, but I cannot even get the most basic test example to work.
And yes, I have read the RewriteHeader documentation many times over.
I am using ISAPI_Rewrite 3 Release 3.1.0.105
The ISAPI_Rewrite 3 documentation does not provide even one actual example of the RewriteHeader rule in use, so I have no idea what I'm doing wrong. Any help would be greatly appreciated.
I'm trying to use RewriteHeader to set some headers when loading a .png file.
To test this, I've set my entire .htaccess file to read as follows:
- Code: Select all
RewriteEngine On
RewriteBase /
RewriteHeader MyHeader: .* "Hello this is working" [L]
Absolutely nothing happens. This header is nowhere to be found.
I have also tried removing the quotation marks to have the rule read:
- Code: Select all
RewriteHeader MyHeader: .* Hello this is working [L]
This also does nothing.
My end goal is to be able to set Cache-Control headers on images that are loaded, but I cannot even get the most basic test example to work.
And yes, I have read the RewriteHeader documentation many times over.
I am using ISAPI_Rewrite 3 Release 3.1.0.105
The ISAPI_Rewrite 3 documentation does not provide even one actual example of the RewriteHeader rule in use, so I have no idea what I'm doing wrong. Any help would be greatly appreciated.
Re: RewriteHeader does not work at all
Are you understanding that RewriteHeader will change *incoming* headers only? Do you have a "MyHeader" header coming in as part of the browser request? If not, this rule will never match anything.
If you want to change the values of headers that are part of the *output* from the page, I think you'll need to upgrade to Ape.
If you want to change the values of headers that are part of the *output* from the page, I think you'll need to upgrade to Ape.
Re: RewriteHeader does not work at all
Hello.
Yep, RewriteHeader is for incoming headers rewrite. ISAPI_Rewrite does not offer outgoing rewrites, however, Helicon Ape does. With Ape you actually have number of options, including mod_replace: https://www.helicontech.com/ape/doc/mod ... acePattern, mod_header: https://www.helicontech.com/ape/doc/mod ... htm#Header and since you've mentioned you need it for Cache-Control I suggest you to look into mod_expires instead: https://www.helicontech.com/ape/doc/mod_expires.htm
And read this article: http://www.helicontech.com/articles/mak ... rk-faster/ it may have the answers you actually need.
Yep, RewriteHeader is for incoming headers rewrite. ISAPI_Rewrite does not offer outgoing rewrites, however, Helicon Ape does. With Ape you actually have number of options, including mod_replace: https://www.helicontech.com/ape/doc/mod ... acePattern, mod_header: https://www.helicontech.com/ape/doc/mod ... htm#Header and since you've mentioned you need it for Cache-Control I suggest you to look into mod_expires instead: https://www.helicontech.com/ape/doc/mod_expires.htm
And read this article: http://www.helicontech.com/articles/mak ... rk-faster/ it may have the answers you actually need.
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 25 guests