由于我们使用的是免备案空间,并且使用的是IIS6 ,很多客户都找的是LIUNX服务器的规则很不适用,我们下面给大家分享,我们如果是wordpress程序,那么我们免备案虚拟主机如何配置wordpress的伪静态规则,我们之前讲过DZ的伪静态,下面来讲wordpress规则。
wordpress是一款国外开源博客程序,这款博客程序不仅能够做成博客程序,还可以做成门户网站,影视网站,并且能够二次开发为论坛,可谓是最强大的博客程序,过内外使用者最多的CMS。
我们首先需要建议一个文件夹,我们建立一个httpd.ini(一般IIS6都是HTTPD.INI规则)建立好,向里面复制下列代码。
[ISAPI_Rewrite] # 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 /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]
然后我们把httpd.ini上传到免备案空间的FTP,WEB根目录下。
然后登陆wordpress后台,需要在后台设置下:/%post_id%.html 去固定连接格式。
然后大家可以打开自己的网站,查看伪静态是否生效咯。本伪静态规则只适合我们虚拟主机,或者IIS6的虚拟主机,别的虚拟主机请自测。
|