perl-asp mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John D. Leonard II" <john.leon...@ce.gatech.edu>
Subject Problem with mod_rewrite
Date Sat, 16 Jun 2001 06:23:19 GMT
All:

I realize that this is not an Apache::ASP problem, but perhaps someone with
a bit more experience with mod_rewrite can help me out.

I got the idea for this rewrite from a recent post to this list.  I
regularly use the "pathinfo" portion of a URI to access specific tables and
records in a data base.  For example, the URI

http://www.a3a10.gati.org/index.asp/committees/2

asks my ASP script to look up record "2" in table "committees".

I want apache to rewrite an incoming URI so I don't have to include the
"index.asp" when one of my keyword table names is recognized.  For example,
when apache sees my keyword "/committees"  at the beginning of a URI, I want
it to substitute a file name, and then the keyword.  For example:

/committees/2  -> /index.asp/committees/2

I can not get mod_rewrite to utilize the grouping characters in the rewrite
rule.  Mod_rewrite is recognizing the need to substitute, and is placing the
/index.asp/ into the line, but is not using the $1 and $2 groups.

I'm running apache 1.3.20, mod_perl 1.25, perl 5.6.0, Apache::ASP 2.15 on
AIX 4.3.3.

Here is the snippet from my httpd.conf:

<VirtualHost 128.61.129.200:80>
    ServerName www.a3a10.gati.org
    ServerAdmin john.leonard@ce.gatech.edu
    DocumentRoot "/home/htdocs/a3a10"
    ErrorLog logs/a3a10_error_log
    CustomLog logs/a3a10_access_log common
    RewriteEngine on
    RewriteLog logs/rewrite
    RewriteLogLevel 9
    RewriteRule  ^/(committees)(.*)     /index.asp/$1$2
</VirtualHost>

Here is the complete mod_rewrite logfile output:

64.192.123.105 - - [16/Jun/2001:01:55:29 -0400]
[www.a3a10.gati.org/sid#200ee070][rid#200fe200/initial] (2) init rewrite
engine with requested uri /committees/2
64.192.123.105 - - [16/Jun/2001:01:55:29 -0400]
[www.a3a10.gati.org/sid#200ee070][rid#200fe200/initial] (3) applying pattern
'^/(committees)(.*)' to uri '/committees/2'
64.192.123.105 - - [16/Jun/2001:01:55:29 -0400]
[www.a3a10.gati.org/sid#200ee070][rid#200fe200/initial] (2) rewrite
/committees/2 -> /index.asp/

                                               ^^^^^^^^^^^???????
The $1 and $2 are empty!

64.192.123.105 - - [16/Jun/2001:01:55:29 -0400]
[www.a3a10.gati.org/sid#200ee070][rid#200fe200/initial] (2) local path
result: /index.asp/
64.192.123.105 - - [16/Jun/2001:01:55:29 -0400]
[www.a3a10.gati.org/sid#200ee070][rid#200fe200/initial] (2) prefixed with
document_root to /home/htdocs/a3a10/index.asp/
64.192.123.105 - - [16/Jun/2001:01:55:29 -0400]
[www.a3a10.gati.org/sid#200ee070][rid#200fe200/initial] (1) go-ahead with
/home/htdocs/a3a10/index.asp/ [OK]
64.192.123.105 - - [16/Jun/2001:01:55:29 -0400]
[www.a3a10.gati.org/sid#200ee070][rid#20102240/subreq] (2) init rewrite
engine with requested uri /
64.192.123.105 - - [16/Jun/2001:01:55:29 -0400]
[www.a3a10.gati.org/sid#200ee070][rid#20102240/subreq] (3) applying pattern
'^/(committees)(.*)' to uri '/'
64.192.123.105 - - [16/Jun/2001:01:55:29 -0400]
[www.a3a10.gati.org/sid#200ee070][rid#20102240/subreq] (1) pass through /

What am I missing?  It has got to be something simple!  I've tried a variety
of combinations (fiddling for about 5 hours) without any luck!

Thanks,

JL
------
John D. Leonard II, Associate Professor            Phone: 404/894-2360
School of Civil and Environmental Engineering       FAX:  404/894-2278
Georgia Institute of Technology           http://traffic.ce.gatech.edu
Atlanta, GA  30332-0355              mailto:john.leonard@ce.gatech.edu


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Mime
View raw message