Jump to content

Apache rewrite rule isn't working in version 2.0


sjwood0

Recommended Posts

Hello All

 

I'd be very grateful of some Apache Gurus help with this. I have a rewrite rule that was previously working fine on Apache1.3 but doesn't work on Apache2.0. Looking at the rewrite log the rewrite bit works OK and it's down to what apache does when a path you type in isn't there(because in this case it's a parameter I'm passing to something else). How to I change my setup so Apache doesn't see this as a forbidden request???

 

Here's the address I type in... http://some-server.com/parameter/sss

In Apache1.3 this gets a "400 Bad Request" error but the proxy/rewrite bit works

In Apache2.0 this gets a "403 Forbidden" error and doesn't

 

 

And the httpd.conf entry (same in both servers)....

<VirtualHost _default_:80>

    ServerName some-server.com

    DocumentRoot "/opt/apache2/htdocs"

        RewriteEngine           On

        RewriteLog              "/opt/apache2/logs/rewrite1.log"

        RewriteLogLevel         9

        RewriteCond     %{REQUEST_URI} ^/parameter/([a-zA-Z0-9_]+)$ [NC]

        RewriteRule     ^/parameter/([a-zA-Z0-9_]+)$      http://sometomcatserver.com?urlsuffix=$1&ipaddress=%{REMOTE_ADDR} [P]

</VirtualHost>

 

 

Heres a snip of the 1.3 rewrite log showing it working.....

 

192.168.219.192 - - [28/Feb/2007:10:54:07 +0000] [some-server.com/sid#ad70

8][rid#c7d70/initial] (3) split uri=http://sometomcatserver.com?urlsuffix=sss&ipaddress=192.168.219.192 -> uri=http://sometomcatserver.com, args=urlsuffix=sss&ipaddress=192.168.219.192

192.168.219.192 - - [28/Feb/2007:10:54:07 +0000] [some-server.com/sid#ad70

8][rid#c7d70/initial] (2) forcing proxy-throughput with http://sometomcatserver.com

192.168.219.192 - - [28/Feb/2007:10:54:07 +0000] [some-server.com/sid#ad70

8][rid#c7d70/initial] (1) go-ahead with proxy request proxy:http://sometomcatserver.com [OK]

 

 

And a snip of the 2.0 rewrite log showing it NOT working.....

 

6cc10/initial] (3) applying pattern '^/parameter/([a-zA-Z0-9_]+)$' to uri '/parameter/sss'

64.35.70.108 - - [28/Feb/2007:10:17:42 +0000] [sometomcatserver.com/sid#81259b0][rid#816cc10/initial] (4) RewriteCond: input='/parameter/sss' pattern='^/parameter/([a-zA-Z0-9_]+)$' => matched

64.35.70.108 - - [28/Feb/2007:10:17:42 +0000] [sometomcatserver.com/sid#81259b0][rid#816cc10/initial] (2) rewrite /parameter/sss -> http://sometomcatserver.com?urlsuffix=sss&ipaddress=64.35.70.108

64.35.70.108 - - [28/Feb/2007:10:17:42 +0000] [sometomcatserver.com/sid#81259b0][rid#816cc10/initial] (3) split uri=http://sometomcatserver.com?urlsuffix=sss&ipaddress=64.35.70.108 -> uri=http://sometomcatserver.com, args=urlsuffix=sss&ipaddress=64.35.70.108

64.35.70.108 - - [28/Feb/2007:10:17:42 +0000] [sometomcatserver.com/sid#81259b0][rid#816cc10/initial] (2) forcing proxy-throughput with http://sometomcatserver.com

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.