多语言展示
当前在线:1241今日阅读:195今日分享:14

WordPress伪静态IIS规则

让你的IIS服务器也能完美支持wordpress博客系统,下面介绍WordPress在IIS下伪静态规则。
工具/原料
1

web服务器

2

电脑,浏览器

方法/步骤
1

今天博客换成了WordPress系统比较顺畅,初步设计页面就是现在的模板,该模板是大侠dafi制作,好了言归正传下面介绍WordPress在IIS下伪静态规则,顺便介绍IIS/Apache/Nginx这三个主流系统的WordPress伪静态规则。

2

首先本地调试好所有内容然后上传到服务器,小编使用的是IIS,就以IIS为主介绍吧,其他都差不多通用~~~~~~~~~~~~~

3

首先进入首台固定链接设置,然后设置你需要的链接格式,以上是我原先网站的链接格式,经过调试后一切和原先一样。然后给IIS添加 WordPress IIS伪静态 httpd.ini文件在httpd目录新建一个httpd.ini文件,然后复制下面的代码进去》保存

4

[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 /tag/(.*) /index\.php\?tag=$1 RewriteRule /software-files/(.*) /software-files/$1 [L] RewriteRule /images/(.*) /images/$1 [L] RewriteRule /sitemap.xml /sitemap.xml [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]

注意事项
1

注意编辑任何PHP文件请勿使用windows原生记事本编辑器

2

此文件在IIS6.0实际验证,完美解决wordpress在IIS下伪静态问题

推荐信息