httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Csaba Gabor <csaba2...@yahoo.com>
Subject Can I avoid an implicit redirect?
Date Mon, 24 Jun 2002 04:52:14 GMT
Here I am with Apache 2, PHP 4.2, Windows 2K, and a problem.  I have a site with main page
http://mydomain.us/index.php and there are a few other top level pages and files.  Almost
everything goes through index.php and I'd like to tidy up some of my links so that instead
of
mydomain.us?Query=BigUglyThing&Goes=OnForever I can write something like
mydomain.us/key1/val1/key2/val2/you/get/the/idea

So I appeal to the handy, dandy ModRewrite and come up with something like (perhaps I could
get
rid of first two lines):
    RewriteRule ^/?$ - [L]
    RewriteRule ^/\? - [L]
    RewriteRule ^/[^/.]*\.(php|js|htm)(\?|$) - [NC,L]
    RewriteRule \.(gif|jpg)$ - [NC,L]
    RewriteRule ^/index.php/ - [NC,L]
    RewriteRule ^(.*)$ http://mydomain.us/index.php$1 [NS,L]

Only that final line does any rewriting, and this works (putting the extra information into
PATH_INFO), I get the page, and life is good.  But, oh no! The address in the browser window
has
changed (same change happens even if prefixed with http://) from mydomain.us/this/is/a/test/
to
http://mydomain.us/index.php/this/is/a/test/
This is ugly.  And unfair.  OK, maybe that's going overboard, but I don't want it.

The culprit is that last RewriteRule line and the logfile says:
1.2.3.4 - - [23/Jun/2002:22:55:34 --0500] [MyDomain.us/sid#53e688][rid#56f7f0/initial] (3)
applying pattern '^(.*)$' to uri '/this/is/a/test/'
1.2.3.4 - - [23/Jun/2002:22:55:34 --0500] [MyDomain.us/sid#53e688][rid#56f7f0/initial] (2)
rewrite /this/is/a/test/ -> http://mydomain.us/index.php/this/is/a/test/
1.2.3.4 - - [23/Jun/2002:22:55:34 --0500] [MyDomain.us/sid#53e688][rid#56f7f0/initial] (2)
implicitly forcing redirect (rc=302) with http://mydomain.us/index.php/this/is/a/test/

Is there any way to avoid that implicit redirect in the above line?

    Thanks,
        Csaba Gabor from New York

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message