RewriteRule用于WordPress上的分类RSS提要

时间:2011-12-01 19:51:26

标签: wordpress .htaccess rewrite

我正在尝试将sufix / rss2添加到RSS源的默认WordPress URL。

我想 http://www.mydomain.com/blog/category/news/feed/http://www.mydomain.com/blog/category/news/feed/rss2

为了做到这一点,我正在使用这个RewriteRule:

RewriteRule ^blog/category/([^/])/feed/?$ http://www.mydomain.com/blog/category/$1/feed/rss2/ [NC,L]

但我不能让它发挥作用。不知何故,WordPress rewriterules忽略了我的。

我的博客安装在/ blog目录下,我试图在.htaccess中的WordPress模块​​之前和之后放置此规则:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On

[[[[I tried to put it here with no luck]]]]

RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress

[[[[I tried to put it here too with no luck]]]]

关于如何做的任何想法?非常感谢!

1 个答案:

答案 0 :(得分:0)

[已解决]问题是RewriteRule,这是正确的:

RewriteRule ^blog/category/(.*)/feed/?$ http://www.mydomain.com/blog/category/$1/rss2/ [L,R=301]