为了这个permalinks(永久链接) 真是花费我好多的时间,从星玄宇那里知道蓝风的httpd.ini规则文件设置,但用到我WordPress上就一直没有效果,于是一直在找原因,期间让服务器的管理员帮忙覆盖文件N次,这里感激一下速度吧的技术管理员,耐心真的很好,后来我在自己机器上架了一个WordPress的运行环境,才找到了失败的原因,缺少对 UriMatchPrefix 和 UriFormatPrefix 的设置。因为我的WordPress有一层目录,所以直接把蓝风的httpd.ini文件拿过来不能直接使用。
蓝风原文 WordPress permalinks(永久链接) rewrite rules for IIS
贴一下我的 httpd.ini文件,希望对后来者有所帮助
[ISAPI_Rewrite] # WordPress rewrite rules # Design by Kevin http://www.bluefeel.com # /%year%%monthnum%%day%/%postname%/ # UriMatchPrefix \/weblog # UriFormatPrefix \/weblog RewriteRule /php /phpinfo RewriteRule /tag/(.*) /index\.php\?tag=$1 RewriteRule /(aboutme|works|resources|guestbook|archives|sitemap|links|works|pluginsused)/ /index.php\?pagename=$1 RewriteRule /category/(.*)/(feed|rdf|rss|rss2|atom)/?$ \/weblog\/wp-feed.php\?category_name=$1&feed=$2 RewriteRule /category/?(.*)/ /index.php\?category_name=$1 RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom)/?$ \/weblog\/wp-feed.php\?author_name=$1&feed=$2 RewriteRule /author/?(.*) /index.php\?author_name=$1 RewriteRule /feed/?$ \/weblog\/\?feed=rss2 RewriteRule /comments/feed/?$ \/weblog\/\?feed=comments-rss2 RewriteRule /page/(.*)/ /index.php\?paged=$1 RewriteRule /([0-9]{4})([0-9]{1,2})([0-9]{1,2})/([^/]+)/?([0-9]+)?/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&page=$5 RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4 RewriteRule /([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3 RewriteRule /([0-9]{4})([0-9]{1,2})([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&feed=$5 RewriteRule /([0-9]{4})([0-9]{1,2})([0-9]{1,2})/([^/]+)/trackback/?$ \/weblog\/wp-trackback.php\?year=$1&monthnum=$2&day=$3&name=$4&tb=1 RewriteRule /sitemap/(.*)/ /index.php\?page_id=3&pg=$1
因为我有层目录,所以要加UriMatchPrefix 和 UriFormatPrefix 的设置
其中(aboutme|works|resources|guestbook|archives|sitemap|links)部分是对单独页面的解析,“|”分隔页面。
中文关键字:blog iis isapi permalinks plugins rewrite wordpress 服务器 永久链接 永久 链接 rules for rewriterule feed
相关日志 :
Tags: Blog, IIS, ISAPI, permalinks, Plugins, rewrite, WordPress, 服务器, 永久链接
This entry was posted
on 星期五, 六月 15th, 2007 at 4:33 下午 and is filed under WordPress.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
[...] 为了完美的实现伪静态,快被permalinks的404错误整死了。 经过N多资料的收集,让空间商的客服和我一起忙了半天,终于在傻瓜不傻的博客上找到了一个很好了httpd.ini的解决方案。当然最早写这个httpd.ini是蓝风。 (本来用甜蚂蚁(转)的解决方案可以实现postname%.html的,可是由于没有完全看懂代码,最后被替换掉了。也不想再麻烦空间商了。) [...]