Apache mod_重写删除查询并保留字符串
简单的问题(我希望如此)。 我需要从url中删除查询并重写它,只保留字符串 例如:Apache mod_重写删除查询并保留字符串,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,简单的问题(我希望如此)。 我需要从url中删除查询并重写它,只保留字符串 例如: http://example.com/photography/?c=events 最终结果应该是: http://example.com/photography/events 那么: RewriteEngine on # capture the value of c parameter of the query string (as %1) RewriteCond %{QUERY_STRING} (?:^|
http://example.com/photography/?c=events
最终结果应该是:
http://example.com/photography/events
那么:
RewriteEngine on
# capture the value of c parameter of the query string (as %1)
RewriteCond %{QUERY_STRING} (?:^|&)c=([^&]+)
RewriteRule ^photography/$ $0%1? [L]
?可能的副本