Forum Moderators: phranque
I'm very new to apache filters.
I' trying to use as an external filter sed for rewriting internal links like:
s/index2.jsp?NAV=1426&LNG=DE/de\/haftungsausschluss\//gi
Afterwards I would like to gzip the content.
Zipping works fine and the sed is working great, but in combination it doesn't.
I believe I have to change the filtering order. But I don't know how.
I'm trying with ftype and it didn't resolve the problem. Perhaps I used the wrong syntax!?
Here is the part out of the httpd.conf I'm working with:
###########################
ExtFilterDefine helluxlink mode=output intype=text/html cmd="c:/Programme/GnuWin32/bin/sed.exe -f D:/cvs_data/hellux_home/regexp/replace.txt" ftype=10
ExtFilterDefine helluxlinkx mode=output intype=application/xml cmd="c:/Programme/GnuWin32/bin/sed.exe -f D:/cvs_data/hellux_home/regexp/replace.txt" ftype=10
<Location /hellux_home/>
# core directive to cause the fixtext filter to
# be run on output
SetOutputFilter helluxlink;helluxlinkx
################ GZIP Content
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif¦jpe?g¦png¦swf¦pdf)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
################ GZIP Content
</Location>
#######################
It would be great if someone could help me!
Thanks a lot in advance.
benjamin
Benjamin
Jim