【发布时间】:2015-03-04 16:30:24
【问题描述】:
我想通过使用页面标题而不是 php get 方法来改进我的网站。
如果我要将/index.php?id=1 转换为/page,我需要在.htacces 中写什么
【问题讨论】:
-
将需要的不仅仅是 mod_rewrite,除非您打算为每个页面 id 编写规则。
index.php需要一种将每个 fake URL 映射到实际页面 id 的方法,通常使用一种 db 查找表:有关重写部分,请参阅 stackoverflow.com/questions/18406156/…。 -
这个语法更好,我把代码格式化了。应该澄清“使用页面标题而不是php”
标签: php apache .htaccess rewrite server