Mod-rewrite url from /example.php?id=1 to /example/title-of-page
问题 I have a website that generates urls like: www.site.com/example.php?id=1 I would like that url to be displayed like: www.site.com/example/the-title-of-the-page-whatever-it-may-be Can I do this in .htaccess or do I need to edit the php or what? Be gentle, and treat me like an idiot please - I'm brand new to all this :) 回答1: If your using a apache server you can use mod rewrite 回答2: Use this for your htaccess : RewriteEngine On RewriteRule ^([^/]*).html$ /example.php?id=$1 [L] Your Old URL >