httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Csaba Gabor <>
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 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 I can write something like

So I appeal to the handy, dandy ModRewrite and come up with something like (perhaps I could
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 ^(.*)$$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
changed (same change happens even if prefixed with http://) from
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: - - [23/Jun/2002:22:55:34 --0500] [][rid#56f7f0/initial] (3)
applying pattern '^(.*)$' to uri '/this/is/a/test/' - - [23/Jun/2002:22:55:34 --0500] [][rid#56f7f0/initial] (2)
rewrite /this/is/a/test/ -> - - [23/Jun/2002:22:55:34 --0500] [][rid#56f7f0/initial] (2)
implicitly forcing redirect (rc=302) with

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

        Csaba Gabor from New York

Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message