httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jurgen <apa...@squarehosting.com>
Subject Re: [users@httpd] mod_rewrite to shorten URLs (problem)
Date Sun, 22 Dec 2002 21:45:00 GMT
Hi,

let's start from the requested URL, which is already rewritten, and I guess it shouldn't.

> 
> Everything seems to go fine, but still that 404. Now I try the full URL 
> of http://test.theoretic.com/bin/view/Main/Home, and TWiki treats it 
> like URL http://test.theoretic.com/view/Home (Note it is missing the 
> 'bin' and 'Main' parts from the URL). This returns an error in TWiki, 
> since there is no category called 'Home' (it is supposed to be 'Main'). 
> That produced this in the rewrite_log file:
> 
> 209.26.25.155 - - [22/Dec/2002:13:05:25 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (2) init rewrite 
> engine with requested uri /Main/Home

as you can see it starts with /Main/Home instead of /bin/view/Main/Home. The reason is that
you used %{REQUEST_FILENAME} instead of %{REQUEST_URI}, so it matches !/bin/ and !/pub/ and
it doesn't seem to me that you intent that.

Check this out first and the we see from there.

Jurgen


> 209.26.25.155 - - [22/Dec/2002:13:05:25 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (3) applying 
> pattern '^(.*)$' to uri '/Main/Home'
> 209.26.25.155 - - [22/Dec/2002:13:05:25 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (4) RewriteCond: 
> input='/Main/Home' pattern='!/bin/' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:25 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (4) RewriteCond: 
> input='/Main/Home' pattern='!/pub/' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:25 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (4) RewriteCond: 
> input='/home/theoretic/test/data/Main/Home.txt' pattern='-f' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:25 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (2) rewrite 
> /Main/Home -> /bin/viewauth/Main/Home
> 209.26.25.155 - - [22/Dec/2002:13:05:25 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (3) applying 
> pattern '^/[^/]+/(.*)$' to uri '/bin/viewauth/Main/Home'
> 209.26.25.155 - - [22/Dec/2002:13:05:25 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (4) RewriteCond: 
> input='/bin/viewauth/Main/Home' pattern='!/bin/' => not-matched
> 209.26.25.155 - - [22/Dec/2002:13:05:25 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (2) local path 
> result: /bin/viewauth/Main/Home
> 209.26.25.155 - - [22/Dec/2002:13:05:25 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (1) go-ahead with 
> /bin/viewauth/Main/Home [OK]
> 
> 209.26.25.155 - - [22/Dec/2002:13:05:31 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (2) init rewrite 
> engine with requested uri /bin/view/Main/Home
> 209.26.25.155 - - [22/Dec/2002:13:05:31 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (3) applying 
> pattern '^(.*)$' to uri '/bin/view/Main/Home'
> 209.26.25.155 - - [22/Dec/2002:13:05:31 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (4) RewriteCond: 
> input='/bin/view/Main/Home' pattern='!/bin/' => not-matched
> 209.26.25.155 - - [22/Dec/2002:13:05:31 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (3) applying 
> pattern '^/[^/]+/(.*)$' to uri '/bin/view/Main/Home'
> 209.26.25.155 - - [22/Dec/2002:13:05:31 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (4) RewriteCond: 
> input='/bin/view/Main/Home' pattern='!/bin/' => not-matched
> 209.26.25.155 - - [22/Dec/2002:13:05:31 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (1) pass through 
> /bin/view/Main/Home
> 209.26.25.155 - - [22/Dec/2002:13:05:31 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (2) init rewrite 
> engine with requested uri /Main/Home
> 209.26.25.155 - - [22/Dec/2002:13:05:31 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (3) applying 
> pattern '^(.*)$' to uri '/Main/Home'
> 209.26.25.155 - - [22/Dec/2002:13:05:31 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (4) RewriteCond: 
> input='/Main/Home' pattern='!/bin/' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:31 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (4) RewriteCond: 
> input='/Main/Home' pattern='!/pub/' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:31 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (4) RewriteCond: 
> input='/home/theoretic/test/data/Main/Home.txt' pattern='-f' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:31 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (2) rewrite 
> /Main/Home -> /bin/viewauth/Main/Home
> 209.26.25.155 - - [22/Dec/2002:13:05:31 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (3) applying 
> pattern '^/[^/]+/(.*)$' to uri '/bin/viewauth/Main/Home'
> 209.26.25.155 - - [22/Dec/2002:13:05:31 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (4) RewriteCond: 
> input='/bin/viewauth/Main/Home' pattern='!/bin/' => not-matched
> 209.26.25.155 - - [22/Dec/2002:13:05:31 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (2) local path 
> result: /bin/viewauth/Main/Home
> 209.26.25.155 - - [22/Dec/2002:13:05:31 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (1) go-ahead with 
> /bin/viewauth/Main/Home [OK]
> 
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (2) init rewrite 
> engine with requested uri /oops/Home/Home
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (3) applying 
> pattern '^(.*)$' to uri '/oops/Home/Home'
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (4) RewriteCond: 
> input='/oops/Home/Home' pattern='!/bin/' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (4) RewriteCond: 
> input='/oops/Home/Home' pattern='!/pub/' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (4) RewriteCond: 
> input='/home/theoretic/test/data/oops/Home/Home.txt' pattern='-f' => 
> not-matched
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (4) RewriteCond: 
> input='/home/theoretic/test/data/oops/Home/Home' pattern='-d' => not-matched
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (3) applying 
> pattern '^/[^/]+/(.*)$' to uri '/oops/Home/Home'
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (4) RewriteCond: 
> input='/oops/Home/Home' pattern='!/bin/' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (4) RewriteCond: 
> input='/oops/Home/Home' pattern='!/pub/' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (4) RewriteCond: 
> input='/oops/Home/Home' pattern='^/([^/]+)/' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (4) RewriteCond: 
> input='/home/theoretic/test/bin/oops' pattern='-f' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (2) rewrite 
> /oops/Home/Home -> /bin/oops/Home/Home
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8243cc4/initial] (2) forcing 
> '/bin/oops/Home/Home' to get passed through to next API URI-to-filename 
> handler
> 
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (2) init rewrite 
> engine with requested uri /Home/Home
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (3) applying 
> pattern '^(.*)$' to uri '/Home/Home'
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (4) RewriteCond: 
> input='/Home/Home' pattern='!/bin/' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (4) RewriteCond: 
> input='/Home/Home' pattern='!/pub/' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (4) RewriteCond: 
> input='/home/theoretic/test/data/Home/Home.txt' pattern='-f' => not-matched
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (4) RewriteCond: 
> input='/home/theoretic/test/data/Home/Home' pattern='-d' => not-matched
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (3) applying 
> pattern '^/[^/]+/(.*)$' to uri '/Home/Home'
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (4) RewriteCond: 
> input='/Home/Home' pattern='!/bin/' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (4) RewriteCond: 
> input='/Home/Home' pattern='!/pub/' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (4) RewriteCond: 
> input='/Home/Home' pattern='^/([^/]+)/' => matched
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (4) RewriteCond: 
> input='/home/theoretic/test/bin/Home' pattern='-f' => not-matched
> 209.26.25.155 - - [22/Dec/2002:13:05:35 -0600] 
> [test.theoretic.com/sid#80bb7f4][rid#8216134/subreq] (1) pass through 
> /Home/Home
> 
> I have tried many various mod_rewrite setups over the past 2 days, 
> tweaking and modifying different aspects. All have failed and at best 
> produced similar results as above. At worst, they always return error 404s.
> 
> Again, apologies for the long post and lots of data. I'm hoping it will 
> help someone much more experienced in mod_rewrite than I am see the problem.
> 
> -- 
>      /\  Adam Theo, Age 23, Tallahassee FL USA
>     //\\   Email & Jabber: theo@theoretic.com
>    //  \\  Cell: (850) 567 1138
> =//====\\=
> //  ||  \\  Theoretic Solutions: http://www.theoretic.com
>      ||         "Building Ideas by Bringing them Together"
>      ||      Jabber Protocol: http://www.jabber.org
>      ||         "The Next Generation Communications Protocol"
>      ||  "A Free-Market Socialist Patriotic American Buddhist"
> 
> 
> ---------------------------------------------------------------------
> 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

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


Mime
View raw message