【发布时间】:2013-10-08 03:05:51
【问题描述】:
我有一个网站,我正在尝试重写它的网址。
这很简单,但我不明白怎么做。
这些页面是下一个:
http://localhost/site/index.php?p=home等home是一个参数,重写应该是这样的:http://localhost/site /home.html
http://localhost/site/section.php?id=someid 我希望它像 http://localhost/site/the-name-of-the -section-from-database-SOMEID
http://localhost/site/product.php?id=someid 我希望它像 http://localhost/site/category-name/product-name -SOMEID
我认为这很简单,但我仍然不明白该怎么做。请帮帮我。
谢谢!
【问题讨论】:
-
我可能错了,但是你不能在本地使用modrewrite。好吧,反正我不能,如果我被证明是错的,我很想知道怎么做!
-
可以在本地使用它,我有一个启用了 mod_rewrite 的站点,它可以工作。
-
好的,那有什么问题呢?你没有提供任何规则?
标签: php regex apache .htaccess mod-rewrite