Re: [users@httpd] RewriteRule being ignored

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

 



David Hull wrote:
<VirtualHost *:80>
  ServerName www.myserver.com
  RewriteEngine On

  RewriteRule ^/gift/(.*)$ http://www.myserver.com/buy.jsp?gift=$1
  RewriteRule ^/refer/(.*)$ http://www.myserver.com/buy.jsp?refer=$1

  ProxyPass /download/ http://www.myserver.com/download/
  ProxyPassReverse /download/ http://www.myserver.com/download/

You're proxying to your same domain? ServerName was set to www.myserver.com and the proxying goes to www.myserver.com on port 80.

May be you're trying to exclude /download/ from being proxied to :8080? If yes, I'd use

ProxyPass /download !
ProxyPass / http://127.0.0.1:8080/

in order to exclude the /download path.

But in this case I'd use only mod_rewrite like

<VirtualHost *:80>
ServerName www.myserver.com
RewriteEngine On
RewriteRule ^/(gift|refer)/(.*)$ http://127.0.0.1:8080/buy.jsp?$1=$2 [P]
RewriteCond $1 !^download
RewriteRule ^/(.*) http://127.0.0.1:8080/$1 [P]

ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>

---------------------------------------------------------------------
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