Forum Moderators: phranque
/info.php?id=1&p=2
to:
/info/1/2 (p=2 won't always be in the url)
this is what i came up with:
RewriteRule ^info/([0-9]+)/([0-9]+) /info.php?id=$1&p=$2 [L]
is this right?
also after rewritten to: /info/1/2 how do i let the rewrite accept a query string, ie:
/info/1/2?something=else
thanks.
Your code as-is will pass through any query string appended to /info/1/2 without any changes.
However, if "/2" may not be present in the requested URL, you'll need to allow for that in the rule:
RewriteRule ^info/([0-9]+)(/([0-9]+))?/?$ /info.php?id=$1&p=$3 [L]
Jim
I hope you have reviewed the documents cited in our forum charter [webmasterworld.com]. If not, you may not be able to get this to work. The chance of success is low if you don't understand how the code works.
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} ^id=7710_0_14_0_C$
RewriteRule ^more\.php$ http://www.example.com/more.php?id=1110_0_14_0_C [R=301,L]