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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.