wordpress htaccess url:将扩展名添加到1个网址

时间:2014-01-27 01:48:10

标签: wordpress .htaccess url url-rewriting

这是原始网址 http://www.mysite.com/product-feed/

它应该是 http://www.mysite.com/product-feed.xml

我的Htaccess

RewriteEngine On
RewriteRule ^/?product-feed.xml$ /product-feed/ [L]

这不起作用。

1 个答案:

答案 0 :(得分:-1)

如果有人要前往http://www.mysite.com/product-feed/,而他们应该转到http://www.mysite.com/product-feed.xml,那么您所拥有的规则就会倒退。 RewriteRule(或Redirect)的语法为:

RewriteRule <the pattern that matches the URL> <what the URL should be>

所以看起来应该是这样的:

RewriteRule ^product-feed/$ /product-feed.xml [L,R]
相关问题