[thelist] mod_rewrite hell

Charlie Llewellin charliel at infohwy.com
Thu May 24 18:25:18 CDT 2001


Hi all,

I have a url such as

/travel/pages/cities.php?city=houston

which I want to change to

page.php?t_dir=pages&t_page=cities.php&city=houston

I have 
RewriteEngine on
RewriteBase /travel
RewriteRule ^pages/([^\?]+)[\?]*(.*)$     page.php?t_dir=pages&t_page=$1&$2

in my .htaccess in the travel directory

Ideally I want the mod_rewrite work whether or not there is a query string
on the original url, but it will not see anything at all after the ? in the
original url

Echoing $t_page always gives cities.php even if the original url contains
cities.php?city=houston.

Regex/Rewrite gurus, what am I doing wrong?

Charlie





More information about the thelist mailing list