You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Klavs Klavsen <kl...@vsen.dk> on 2003/06/25 12:53:34 UTC

[users@httpd] Bug in apache - valid url won't work.

Suddenly my apache rewriterules stopped working (I'm thinking it was
because my second set of rules - the ones that didn't require the
vhost.map wasn't loaded until then.

I get this response:


Bad Request
Your browser sent a request that this server could not understand.


> 
> # match www.*.*
> RewriteCond   %{HTTP_HOST}              ^www\.[^.]+\.[^-]+$ [NC]
> RewriteRule   ^(.+)                     ${lowercase:%{HTTP_HOST}}:$1 [C]
> RewriteRule   ^www\.([^.]+)\.([^.]+):(.*)   $3        [E=domain:$1]
> 
> # match *.*
> RewriteCond   %{HTTP_HOST}              ^[^.]+\.[^-]+$ [NC]
> RewriteRule   ^(.+)                     ${lowercase:%{HTTP_HOST}}:$1 [C]
> RewriteRule   ^([^.]+)\.([^.]+):(.*)         $3       [E=domain:$1]
> 
> # rewrite to correct url and C=use this url instead.
> RewriteRule ^/(.*)$     %{ENV:domain}/html/$1 [C]
> 

this rewrites to the correct URL but doesn't work. 

Anyone have any idea why? 
-- 
Regards,
Klavs Klavsen, GSEC - kl@vsen.dk - http://www.vsen.dk
PGP: 7E063C62/2873 188C 968E 600D D8F8  B8DA 3D3A 0B79 7E06 3C62
See my new hosting service at http://hosting.EnableIT.dk

Working with Unix is like wrestling a worthy opponent. 
Working with windows is like attacking a small whining child 
who is carrying a .38.				



---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Bug in apache - valid url won't work.

Posted by Klavs Klavsen <kl...@vsen.dk>.
On ons, 2003-06-25 at 13:17, Zac Stevens wrote:
> Hi Klavs,
> 
> On Wed, Jun 25, 2003 at 12:53:34PM +0200, Klavs Klavsen wrote:
> > this rewrites to the correct URL but doesn't work. 
> > 
> > Anyone have any idea why? 
> 
> Your error_log should have more details - what does it report when you make
> the request which fails?

According to the rewrite.log:

] (3) applying pattern '^([^/]*)/([^/]+)\.html$' to uri '/Page-3.html'
192.168.1.4 - - [04/Jun/2003:15:58:47 +0200]
[defaulttest.dk/sid#8113c08][rid#822fa48/initial
] (3) applying pattern '^(.+)' to uri '/Page-3.html'
192.168.1.4 - - [04/Jun/2003:15:58:47 +0200]
[defaulttest.dk/sid#8113c08][rid#822fa48/initial
] (4) RewriteCond: input='defaulttest.dk' pattern='^www\.[^.]+\.[^-]+$'
=> not-matched
192.168.1.4 - - [04/Jun/2003:15:58:47 +0200]
[defaulttest.dk/sid#8113c08][rid#822fa48/initial
] (3) applying pattern '^(.+)' to uri '/Page-3.html'
192.168.1.4 - - [04/Jun/2003:15:58:47 +0200]
[defaulttest.dk/sid#8113c08][rid#822fa48/initial
] (4) RewriteCond: input='defaulttest.dk' pattern='^[^.]+\.[^-]+$' =>
matched
192.168.1.4 - - [04/Jun/2003:15:58:47 +0200]
[defaulttest.dk/sid#8113c08][rid#822fa48/initial
] (5) map lookup OK: map=lowercase key=defaulttest.dk ->
val=defaulttest.dk
192.168.1.4 - - [04/Jun/2003:15:58:47 +0200]
[defaulttest.dk/sid#8113c08][rid#822fa48/initial
] (2) rewrite /Page-3.html -> defaulttest.dk/Page-3.html
192.168.1.4 - - [04/Jun/2003:15:58:47 +0200]
[defaulttest.dk/sid#8113c08][rid#822fa48/initial
] (3) applying pattern '^([^.]+)\.([^/.]+)(.*)' to uri
'defaulttest.dk/Page-3.html'
192.168.1.4 - - [04/Jun/2003:15:58:47 +0200]
[defaulttest.dk/sid#8113c08][rid#822fa48/initial
] (2) rewrite defaulttest.dk/Page-3.html -> /Page-3.html
192.168.1.4 - - [04/Jun/2003:15:58:47 +0200]
[defaulttest.dk/sid#8113c08][rid#822fa48/initial
] (5) setting env variable 'domain' to 'defaulttest'
192.168.1.4 - - [04/Jun/2003:15:58:47 +0200]
[defaulttest.dk/sid#8113c08][rid#822fa48/initial
] (3) applying pattern '(.*)/Page-([0-9]+)\.html$' to uri '/Page-3.html'
192.168.1.4 - - [04/Jun/2003:15:58:47 +0200]
[defaulttest.dk/sid#8113c08][rid#822fa48/initial
] (2) rewrite /Page-3.html ->
defaulttest/html/index.php?name=PagEd&page_id=3
192.168.1.4 - - [04/Jun/2003:15:58:47 +0200]
[defaulttest.dk/sid#8113c08][rid#822fa48/initial
] (3) split uri=defaulttest/html/index.php?pageid=3 ->
uri=defaulttest/html/index
.php, args=name=PagEd&page_id=3
192.168.1.4 - - [04/Jun/2003:15:58:47 +0200]
[defaulttest.dk/sid#8113c08][rid#822fa48/initial
] (2) local path result: defaulttest/html/index.php

and the Document appended in front of this means the file exists.
The exact same output comes from when I use the vhost.map solution - and
it serves pages just fine.

But the error log says:

 Invalid URI in request GET /Page-3.html HTTP/1.1

Any ideas?

-- 
Regards,
Klavs Klavsen, GSEC - kl@vsen.dk - http://www.vsen.dk
PGP: 7E063C62/2873 188C 968E 600D D8F8  B8DA 3D3A 0B79 7E06 3C62

Working with Unix is like wrestling a worthy opponent. 
Working with windows is like attacking a small whining child 
who is carrying a .38.				



---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Bug in apache - valid url won't work.

Posted by Zac Stevens <zt...@cryptocracy.com>.
Hi Klavs,

On Wed, Jun 25, 2003 at 12:53:34PM +0200, Klavs Klavsen wrote:
> this rewrites to the correct URL but doesn't work. 
> 
> Anyone have any idea why? 

Your error_log should have more details - what does it report when you make
the request which fails?


Zac

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org