Mod_rewrite不重定向确切的查询字符串

时间:2011-06-09 09:34:01

标签: apache .htaccess mod-rewrite

任何人都可以建议为什么这似乎不起作用?

我正在尝试将http://domain.com/?feed=rss2重定向到http://domain.com/wp-content/staticfeed/rss2.xml

RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} feed=rss2
RewriteRule ^/$ /wp-content/staticfeed/rss2.xml [L,T=application/rss+xml]

1 个答案:

答案 0 :(得分:0)

试试这个......

RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^feed=rss2
RewriteRule ^(.*)$ /wp-content/staticfeed/rss2.xml [L]