Apache mod_proxy_html Substitute: how to re-use part of regex match? (regex variables?)

Posted by goober on Server Fault See other posts from Server Fault or by goober
Published on 2011-02-16T22:40:17Z Indexed on 2011/02/16 23:27 UTC
Read the original article Hit count: 370

Hi all,

Have a unique URL-rewriting situation in Apache.

I need to be able to take a URL that starts with

"\u002f[X]"

or

'\u002f[X]"

Where X is the rest of some URL, and substitute the text

"\u002fmeis2\u002f[X]

I'm not sure how the Regex works in Apache -- I think it's the same as Perl 5? -- but even then I'm a little unsure how this would be done. My hunch is that it has to do with Regex grouping and then using $1 to pull the variable out, but I'm entirely unfamiliar with this process in Apache.

Hoping someone can help -- thanks!

© Server Fault or respective owner

Related posts about apache

Related posts about mod-proxy