Re: [users@httpd] rewrite then reverse proxy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Can the rewrite rules in the .htaccess and the ProxyPassReverse in
server config?

Without the [P] it won't work?


On 7/23/06, Vincent Bray <noodlet@xxxxxxxxx> wrote:
On 7/22/06, Neo Wee Teck <stelgn@xxxxxxxxx> wrote:
> Wonder can this be done....
It can!
> Apache does a rewrite based on a rule, then reverse proxy to the
> actual destination
>
> eg.
>
> Rewrite
> ----------
>
> Request to http://foo.com/news/3843.html
>
> [Some rewrite rules]
> Actual request  -> http://foo.com/news.php?3843
>
> Reverse Proxy
> ---------------------
>
> ProxyPass / http://backend/
>
> Final request -> http://backend/news.php?3843

You need the [P] flag for RewriteRule. Something like,

RewriteRule ^/news/(\d+)\.html http://backend/news.php?$1 [P]
ProxyPassReverse / http://backend/

--
noodl

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux