mod_replace insights
1 post
• Page 1 of 1
mod_replace insights
Hi!
Since I used mod_replace a lot in the last days I got two insights I want to share with you guys:
1) I had an encoding problem (German Umlaute) in my PHP pages. The mode_replace docu mentions this problem (http://www.helicontech.com/ape/doc/mod_replace.htm), but the solution is missing an essential detail:
Instead of SetEnv content-type windows-1251 one has to use SetEnv content-type-charset windows-1251
2) Another problem I had was the backreferencing in my ReplacePattern Rules: The examples in the docu mention \1 as backrefernce, which works for one pattern
e.g. ReplacePattern revproxy "(http|https)://origin.server/" "\1://revproxy/"
But when you need more than one backreference you have to use $1, $2, and so on:
This would *NOT* work: ReplacePattern revproxy "(http|https)://(origin).server/" "\1://\2.server"
but this would work: ReplacePattern revproxy "(http|https)://(origin).server/" "$1://$2.server"
Hope this is useful for someone!
regards
swobi
P.S.: @Helicon: Maybe you could add this to the documentation page?
Since I used mod_replace a lot in the last days I got two insights I want to share with you guys:
1) I had an encoding problem (German Umlaute) in my PHP pages. The mode_replace docu mentions this problem (http://www.helicontech.com/ape/doc/mod_replace.htm), but the solution is missing an essential detail:
Instead of SetEnv content-type windows-1251 one has to use SetEnv content-type-charset windows-1251
2) Another problem I had was the backreferencing in my ReplacePattern Rules: The examples in the docu mention \1 as backrefernce, which works for one pattern
e.g. ReplacePattern revproxy "(http|https)://origin.server/" "\1://revproxy/"
But when you need more than one backreference you have to use $1, $2, and so on:
This would *NOT* work: ReplacePattern revproxy "(http|https)://(origin).server/" "\1://\2.server"
but this would work: ReplacePattern revproxy "(http|https)://(origin).server/" "$1://$2.server"
Hope this is useful for someone!
regards
swobi
P.S.: @Helicon: Maybe you could add this to the documentation page?
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests