【发布时间】:2012-06-25 13:49:18
【问题描述】:
我目前正在使用 htaccess 使用以下方法将单个查询字符串重写为其页面名称,并且工作正常...
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /index.php?page=$1 [QSA]
我的问题是我现在正在尝试在原始查询字符串之上实现其他查询字符串。我可以以/property-listing&property=12-Langworthy-Royston-Grove身份成功访问该页面
但是我希望能够将&property= 重写为正斜杠,因此基本上删除了额外的查询字符串参数,同时在没有传递额外的查询字符串参数的情况下保持正常的重写规则。
感谢您的帮助,
马特。
【问题讨论】:
标签: .htaccess mod-rewrite query-string