【发布时间】:2013-08-05 10:01:47
【问题描述】:
我在尝试传递作为 event_id 的 $_GET 变量(事件)时遇到了困难。该网站是用 PHP 和 Smarty 模板引擎构建的,并且 mod_rewrite 工作正常。
工作链接/查询字符串:
/event.php?event=2
重写:
/events/2
htacces:
重写规则 ^/events/?$ /event.php?event=$1 [QSA]
查看页面时 /events/2 它正在寻找模板 2.inc.html 但 event.php 已经指定模板为 event.inc.html,它应该显示来自 DB 的事件详细信息。
【问题讨论】:
标签: php mod-rewrite get smarty