我使用年/月/帖子名permalinks,还使用下载监控插件来处理文件下载。我在的顶部添加了重写规则。htaccess文件instructions at perishable press.
我只是在另一个博客上做了同样的事情,效果很好。唯一的区别是blog没有使用下载监视器,并且安装在域的根目录中,而不是/blog/
子目录。
如果我注释掉这一行:
RewriteCond %{REQUEST_URI} ^/?feed.* [NC]
它起作用了。我只是好奇,如果这一行行不通,为什么会出现在说明书中?它是否与子目录有关?
.htaccess:
# temp redirect all wordpress feeds to feedburner
# from http://perishablepress.com/press/2008/03/25/redirect-wordpress-feeds-to-feedburner-via-htaccess-redux/
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /blog/
RewriteCond %{REQUEST_URI} ^/?feed.* [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(FeedBurner|FeedValidator) [NC]
RewriteRule ^feed/?.*$ http://feeds.feedburner.com/mysite [L,NC,R=302]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /blog/
RewriteRule ^download/([^/]+)$ http://www.mysite.com/blog/wp-content/plugins/download-monitor/download.php?id=$1 [L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress
最合适的回答,由SO网友:Sean Lee 整理而成
试试这个。这种格式适合我。您不必重复IfModule、RewriteEngine和RewriteBase。
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{HTTP_USER_AGENT} !^.*(FeedBurner|FeedValidator) [NC]
RewriteRule ^feed/?.*$ http://feeds.feedburner.com/mysite [L,NC,R=302]
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
RewriteRule ^download/([^/]+)$ http://www.mysite.com/blog/wp-content/plugins/download-monitor/download.php?id=$1 [L]
</IfModule>
# END WordPress
以下是htaccess的一个很好的操作方法:
http://codeigniter.com/wiki/mod_rewrite/如果您仍然有问题,可以考虑使用插件:http://wordpress.org/extend/plugins/tentbloggers-feedburner-rss-redirect-plugin/screenshots/