This is a discussion on ProxyPass within LocationMatch not working within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi! I am running two apache installations on port 80 (with php4) and 81 (with php5). Now I'd like ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi!
I am running two apache installations on port 80 (with php4) and 81 (with php5). Now I'd like to pass all files ending with .php5 from port-80-apache to port-81-apache I used the following configuration, but it didn't work: <LocationMatch ".*\.php5$"> ProxyPass http://localhost:81/ </LocationMatch> If I use "Deny from all" the files are locked. So the regular expression is correct. If I use <Location /php5> the request is forwarded. So the ProxyPass expression is correct. Does anyone know why this isn't working and what can I do to get it running? thx, Andreas |
|
|||
|
"Andreas Hammerschmidt" <Andreas.Hammerschmidt@gmx.net> wrote in message news:<415c87c6$1@e-post.inode.at>...
> Hi! > > I am running two apache installations on port 80 (with php4) and 81 (with > php5). > > Now I'd like to pass all files ending with .php5 from port-80-apache to > port-81-apache > > I used the following configuration, but it didn't work: > > <LocationMatch ".*\.php5$"> > ProxyPass http://localhost:81/ > </LocationMatch> > > If I use "Deny from all" the files are locked. So the regular expression is > correct. > If I use <Location /php5> the request is forwarded. So the ProxyPass > expression is correct. > > Does anyone know why this isn't working and what can I do to get it running? don't know, but let me get the swiss pocket knife: RewriteEngine On RewriteRule (.*\.php5)$ http://localhost:81/$1 [P,L] Joachim PS: the docs are specifically talking abut a special case of using ProxyPass inside a <Location> header - maybe they meant just that... |
|
|||
|
"Joachim Ring" <jring@web.de> schrieb im Newsbeitrag
news:3ae246c1.0410011616.7143c0f1@posting.google.c om... > "Andreas Hammerschmidt" <Andreas.Hammerschmidt@gmx.net> wrote in message > news:<415c87c6$1@e-post.inode.at>... >> Hi! >> >> I am running two apache installations on port 80 (with php4) and 81 (with >> php5). >> [...] >> Does anyone know why this isn't working and what can I do to get it >> running? > > don't know, but let me get the swiss pocket knife: > > RewriteEngine On > RewriteRule (.*\.php5)$ http://localhost:81/$1 [P,L] > > Joachim > > PS: the docs are specifically talking abut a special case of using > ProxyPass inside a <Location> header - maybe they meant just that... It's working now. Many thanks to you! I had to change it a bit to work correctly, because your version generates "GET //index.php5 HTTP/1.1" instead of "GET /index.php5 HTTP/1.1". So you have to remove the / before $1. My finally working version: RewriteEngine On ProxyPreserveHost On RewriteRule (.*\.php5)$ http://localhost:81$1 [P,L] All .php5 requests are now forwarded to the port-81-apache and the original Hostname is preserved, so links generated by the PHP script link back to the port-80-apache. thx, Andreas |