August 12th, 2008
wordpress iis isapi Permalinks 新规则
Category: Wordpress, Author: humker, Popularity: 1%最近准备用wordpress做一个cms类的站,要考虑Permalinks(也就是简洁url)的问题,url的seo
优化是一个最基础的东西。wordpress的url的问题涉及到url重写(url rewrite)的,url重写是apache的
长项,不过iis加了ISAPI_Rewrite 也差不多,不过规则什么的就要另外考虑了。
前一段时间自己的blog使用了一个中文wordpress网上流传最多的规则,一共三组,也就是本站前几天发布
的一篇blog,
wordpress iis url rewrite
http://www.humker.com/2008/07/26/wordpress-iis-url-rewrite/
这个规则好理解跟apache的其中一类规则一样,就是一条对应一种url相应,用正则表达式给括号变量赋值,
这个规则对分页总是有问题,这就让我不得不考虑其他的方法。
找到了
http://www.binaryfortress.com/wordpress-url-rewrite/
这个专门为wordpress写的iis的rewrite补丁。
好在跟空间商关系不错,让他帮忙装上了,很好用,就一个配置文件,很省事,就是一个问题是不能实现带有.html 这类扩展,路径中带点的
都不行。
今天不知道怎么不管用,估计是影响其他用户,空间商给停了。
这下没办法了,只有搜,还是google的好用。
找到了这个东西
http://www.basilv.com/psd/blog/2006/running-wordpress-20-under-iis
一个全新的 ISAPI_Rewrite 规则
[ISAPI_Rewrite]
# Defend your computer from some worm attacks
#RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# Rules to ensure that normal content gets through
RewriteRule /software-files/(.*) /software-files/$1 [L]
RewriteRule /images/(.*) /images/$1 [L]
RewriteRule /favicon.ico /favicon.ico [L]
# For file-based wordpress content (i.e. theme), admin, etc.
RewriteRule /wp-(.*) /wp-$1 [L]
# For normal wordpress content, via index.php
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php/$1 [L]
一切ok。
PS:
在这里补充一句中文类的网站copy现象太严重了,找这类东西最好用google,挂上美国的代理,搜外国人写的东西。下一篇文章是介绍中文tag,分类,文章名的问题。
相关文章
Tags:iis, isapi, permalinks, Wordpress.
评论数量(0) | Add Comments
本文网址:http://www.humker.com/2008/08/12/wordpress-iis-isapi-permalinks-new-httpd-file/