[thelist] Apache mod_rewrite and PHP SID

Jackson Yee jyee at vt.edu
Wed Feb 5 22:43:11 CST 2003


"Tony Light" <TonyLight at blueyonder.co.uk> wrote in message
news:001e01c2cd03$e94b0900$777ba8c0 at athlon...
> First experiment used the following rule...
> RewriteRule ^/([0-9])/?$                /play/modrewrite/echo.php?id=$1
>
> This takes urls of the form www.mydomain.com/n (where n is a single digit
numeric - and with or without trailing slash) and calls
/play/modrewrite/echo.php with ?id=n appended.
> All hunky dory.
>
> Now the question....
> How can I deal with a query string appended after the url?

Try adding this rule before the rule you posted above

RewriteRule ^/([0-9]/?\?(.+)$ /play/modrewrite/echo.php?id=$1&$2 [L]

There was another method of using the %{QUERY_STRING} environmental variable
and appending it to the rewritten URL as well, but unfortunately, I've lost
those httpd.conf's since I wrote then.

--
Regards,
Jackson Yee
jyee at vt.edu





More information about the thelist mailing list