You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Alexey Vlasov <re...@renton.name> on 2016/08/19 14:40:41 UTC

[users@httpd] RewriteCond: backreferences in TestString

Hi,

I oo dynamically switch PHP versions but it turns out too many rules.
Can it somehow easier?

## PHP 5.2
RewriteCond /patch/ver52 -f
RewriteRule ^([^?]*)\.php(.*)$ http://127.0.0.1:10052%{REQUEST_URI} [NC,L,P]
...
## PHP 5.6
RewriteCond /patch/ver56 -f
RewriteRule ^([^?]*)\.php(.*)$ http://127.0.0.1:10056%{REQUEST_URI} [NC,L,P]

## PHP 7.0
RewriteCond /patch/ver70 -f
RewriteRule ^([^?]*)\.php(.*)$ http://127.0.0.1:10070%{REQUEST_URI} [NC,L,P]

For example, to PHP version of the flag file are substituted in the port
number?

something like this:
RewriteCond /patch/ver(70) -f
RewriteRule ^([^?]*)\.php(.*)$ http://127.0.0.1:100%1%{REQUEST_URI} [NC,L,P]

thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] RewriteCond: backreferences in TestString

Posted by Alexey Vlasov <re...@renton.name>.
On Fri, Aug 19, 2016 at 10:54:51AM -0400, Eric Covener wrote:
> > something like this:
> > RewriteCond /patch/ver(70) -f
> > RewriteRule ^([^?]*)\.php(.*)$ http://127.0.0.1:100%1%{REQUEST_URI} [NC,L,P]
> 
> That's valid, but it doesn't exactly match the subject of the email
> (which would not work)

It doesn't work indeed. I wrote it as an example of how I would like to
do it, in order not to write a big list of those rules that I cited at
first.
I mean for example to make the figure "70" from here:
/patch/ver(70)
move to %1 to the port number http://127.0.0.1:100%1%

Is it possible to put into practice on mod_rewrite?Or may be it is
possible using some other modules in Apache?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] RewriteCond: backreferences in TestString

Posted by Eric Covener <co...@gmail.com>.
> something like this:
> RewriteCond /patch/ver(70) -f
> RewriteRule ^([^?]*)\.php(.*)$ http://127.0.0.1:100%1%{REQUEST_URI} [NC,L,P]

That's valid, but it doesn't exactly match the subject of the email
(which would not work)

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org