我需要一些帮助。我有:
RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
RewriteRule ^catalog/ catalog.php
RewriteRule ^catalog/(.*)/ catalog.php?id=$1使用此重定向时,我未收到(http://www.example.com/catalog/abc/)
GET['id']如何接收GET“‘id”
发布于 2013-07-07 01:48:44
您的第二条规则需要两个标志:
总的来说,你的.htaccess应该是这样的:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
RewriteRule ^catalog/([^/]+)/?$ catalog.php?id=$1 [L,QSA,NC]第二条规则中的QSA标志将确保在添加新的查询参数id时预先保存任何现有的查询字符串
https://stackoverflow.com/questions/17505411
复制相似问题