Forum Moderators: phranque
i'm doing my best to figure out the syntax for the rewrite rule i need, but i can't figure it out.
my aim is to rewrite the following:
www.domain.com/s?i=whatever
TO
www.domain.com/show.php?i=whatever
the closest i think i've gotten is the following: rewriterule ^/s?i=(.*)$ /show.php?id=$1
but it won't work, i feel like maybe the ? in the first parameter isn't doing what i want it to, given that ? is a character that means something for the rewrite
RewriteCond %{QUERY_STRING} ^i=([^&]*)
RewriteRule ^/s$ /show.php?id=%1 [L]
The code, as shown, allows only for a query string starting with "i=<something>" or "i=<blank>" but will not include any trailing parameters -- The match stops if any ampersand is found after the "i=" value.
For more information, see the Apache mod_rewrite documentation [httpd.apache.org].
Jim