How do I convert a PHP query string into a slash-based URL?
问题 I am a pretty skilled programmer, but when it comes to RegEx and rewriting, I am a total n00b. I want to convert a URL from http://www.example.com/lookup.php?id=1 to http://www.example.com/lookup/1/item/ where "item" refers to the name of an item in a database that is being looked-up. I'm using LAMP (Linux, Apache, MySQL, PHP) and I cannot, for the life of me, figure out how to convert the URLs so they are SEO friendly. 回答1: Simple .htaccess example: <IfModule mod_rewrite.c> RewriteEngine On