<分区>
Possible Duplicate:
How to: URL re-writing in PHP?
我的意图是用另一个变量(自定义文本)更改通过 URL 传递的变量 (id)。 为了更清楚,我想更改:
来自
www.mysite.com/page.php?id=14
到
www.mysite.com/page.php?id=the_best_product_for_them
甚至更好
www.mysite.com/product/the_best_product_for_them
我的数据库中已经有一个表将 id='14' 与文本 'the_best_product_for_them' (id, product_name) 相关联
我想这就是 wordpress 对永久链接所做的事情。我也知道如何使用 .htaccess 文件手动执行此操作,但我想动态执行。我需要的是一个从哪里开始的方向,以及实现这个目标需要什么。
服务器是Apache,代码是PHP。
非常感谢, 朱利奥