【发布时间】:2013-10-21 23:45:23
【问题描述】:
尝试使用 .htaccess 进行简单的 URL 重写,但似乎不起作用。
想访问http://www.example.com/shop/index.php?route=information/information&information_id=11
使用网址http://www.example.com/MyGreatClub2013
这是我存储在 www.example.com 根级别的 .htaccess 中的内容
RewriteEngine On
RewriteRule ^/MyGreatClub2013$ /shop/index.php?route=information/information&information_id=11 [NC,L]
我是不是做错了什么蠢事?
【问题讨论】:
-
RewriteRules in 'per-directory' context(就像在
.htaccess中删除了前导斜杠(斜杠位于主机字符串的末尾)。他们也删除了查询字符串,以防您会搞砸的。
标签: regex apache .htaccess mod-rewrite redirect