WordPress在window2003 IIS ISAPI ReWrite下的URL规则_win服务器

为了便于搜索引擎抓取(换句话就是假静态),下面是URL ReWrite的规则,效果看我的chinadigger的链接地址。我目前的Rewrite规则: 

复制代码 代码如下:

[ISAPI_Rewrite] 

# 3600 = 1 hour 
CacheClockRate 3600 

RepeatLimit 32 

# Protect httpd.ini and httpd.parse.errors files 
# from accessing through HTTP 
# WordPress rewrite rules# 

RewriteRule /tag/(.*)/ /index\.php\?tag=$1 
RewriteRule /(about-me|about-copyright|guest-book)/ /index\.php\?pagename=$1 
RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?author_name=$1&feed=$2 
RewriteRule /author/?(.*) /index\.php\?author_name=$1 
RewriteRule /feed/?$ /wp-feed\.php/\?feed=rss2 
RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2 
RewriteRule /page/(.*)/ /index\.php\?paged=$1 

RewriteRule /photo/?([^/]*)?/?([^/]*)?/?([^/]*)?/?([^/]*)?/?$ /wp-content/plugins/fgallery/fim_photos\.php\?$1=$2&$3=$4 [QSA,L,I] 
RewriteRule /photo/?(.*) /wp-content/plugins/fgallery/fim_photos\.php\?$1=$2&$3=$4 [QSA,L,I] 

# /%year%%monthnum%%day%/%postname%/ 

RewriteRule /category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2 
RewriteRule /category/?(.*)/ /index\.php\?category_name=$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&monthn&day=$3&name=$4&feed=$5 
RewriteRule /([0-9]{4})([0-9]{1,2})([0-9]{1,2})/([^/]+)/trackback/?$ /wp-trackback\.php\?year=$1&monthnum=$2&day=$3&name=$4&tb=1 

# /post/%post_id%.html 

RewriteRule /([0-9]+)/?([0-9]+)?/?$ /index\.php\?p=$1&page=$2 
# RewriteRule /post/([0-9]+)/?([0-9]+)?/?$ /index\.php\?p=$1&page=$2 
RewriteRule /post/([0-9]+).html /index\.php\?p=$1 [I] 

RewriteRule /post/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2 
RewriteRule /post/category/?(.*)/ /index\.php\?category_name=$1 

RewriteRule /post/date/([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 /post/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4 
RewriteRule /post/date/([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3 

使用方法(将Wordpres安装在根目录)

去discuz.net的论坛下载Rewrite的压缩包,然后按照安装方法在IIS里面配置好Rewrite,用上面的规则覆盖httpd.ini中原来的内容,再到wordpress的后台,将选项的永久链接部分,使用自定义,然后在框框里面填写上面粗体部分的内容(两种选一种,其中# /post/%post_id%.html还不太完善),即可。

本文引用bluefeel所写的规则。原文中TAG编写有问题,我已经更改完毕,大家要注意写法,否则会影响其他IIS站点目录。

时间: 2024-07-28 13:05:24

WordPress在window2003 IIS ISAPI ReWrite下的URL规则_win服务器的相关文章

Tipask 2.5版IIS ISAPI rewrite 2.0伪静态规则

  以下伪静态规则适用于服务器为windows系统IIS之ISAPI rewrite 2.0版本,为完美解决Tipask2.5版伪静态规则.   规则如下,全文复制即可,如有其它规则,请检查是否会存在冲突导致部分规则失效,尽量单独使用.   [ISAPI_Rewrite]   # 3600 = 1 hour   CacheClockRate 3600   RepeatLimit 32   RewriteRule ^(.*)/q-(.*).html*$ $1/?q-$2.html   Rewrit

IIS防盗链 ISAPI Rewrite图片防盗链规则写法_服务器其它

通过G.CN和B.CN搜索后得出了几种不同的方案,例如网站程序的URL伪装法.服务器端的收费插件法和ISAPI-REWRITE的规则过滤法等,考虑自身网站结构和钱包的困难问题,最终选择了后者,即现在流行用来做伪静态的ISAPI Rewrite书写规则来实现我的防盗链"梦想". 为什么说是梦想呢?首先表示惋惜,懒人我搜来了一大票经过无数次转载而来的文章,把现呈的代码应用后发现要么根本不起作用,要么就是效果达不到我想要的,几经周折后终于把这原本认为可以轻易借鉴照搬的防盗链给完成了,恨那些只

windwos下IIS日志时间问题的解决方法_win服务器

看过IIS日志时间的人都知道,IIS默认情况下记录的时间是格林威治时间,也就是与我们使用的北京时间相差8个小时,这样一来看日志就很不方便. 我们通过一个很小的设置让IIS日志时间使用服务器设置的时区的时间,我们使用的北京时间也就是+8区,一般来说安装操作系统的时候已经设置过了.下面对IIS进行设置(以Windows2003+IIS6为例): 打开"Internet 信息服务(IIS)管理器",点击"Internet信息服务"."本地计算机".&q

IIS下ASP目录漏洞和IIS分号漏洞(;)的临时解决方法_win服务器

解决方法: 下载 银月服务器工具,使用工具->组件下载器下载ISAPI_Rewrite,解压出来. 把ISAPI_Rewrite中的ISAPI_Rewrite.dll添加为ISAPI,名字为ISAPI_Rewrite,这就是伪静态,做过的不用安装了 下载漏洞补丁包,即下图选择的项目,下载打开! 把ISAPI_Rewrite目录中的httpd.ini替换成补丁包中的httpd.ini. 或者保证ISAPI_Rewrite下面的httpd.ini有下图选择的两行规则也行!这样就能防止这两个IIS漏洞

win7下IIS的安装和配置 图文教程_win服务器

最近工作需要IIS,自己的电脑又是Windows7系统,找了下安装的方法,已经安装成功.在博客里记录一下,给需要的朋友,也是给自己留个备份,毕竟我脑子不是很好使. 一.首先是安装IIS.打开控制面板,找到"程序与功能",点进去 二.点击左侧"打开或关闭Windows功能" 三.找到"Internet 信息服务",按照下图打勾即可 等待安装完成 四.安装完成后,再回到控制面板里面,找到"管理工具",点进入 五.双击"I

PHP在64位Win2003和IIS下运行设置方法_win服务器

PHP在64位Windows2003和IIS下运行 首先将IIS由64位模式修改为32位模式,只要一个命令即可: cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1 恢复为64位模式的命令: cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32

win2003下 iis+php快速稳定的配置方法_win服务器

这里小编根据我们这么长时间的经验,特别分享下windows 2003系统下iis+php的配置方法,简单易用,而且还稳定. 第一步: 下载这个软件就可以了 星外PHP5.2.17自动配置安装包 快捷配置iis php运行环境,这个是星外发布的对于没有对iis配置过php环境的朋友使用,这个版本是安装在c盘的,使用液不会受到影响,默认开启了很多扩展,基本上是php 5.2.*系列中比较稳定的版本了. 根据我们几十台服务器的安全测试,绝对是没有问题的. 第二步:解压后直接安装就可以了,默认下就支持p

Windows IIS配置Jsp和php环境方法_win服务器

一.IIS用于ASP程序的处理,但是想要它可以处理JSP和php呢?最容易想到的就是JSP安装TOMCAT就好了,TOMCAT默认的端口是8080,默认安装好后的成功页面:http://127.0.0.1:8080/index.jsp;php用Apache就好了,配置好了就可以了.有集成了Mysql和MysqlAdmin的AppServ.Apache和IIS都是默认用80端口,那它们就有冲突,只能启动其中一个,也就是支持php就不支持asp了.对于jsp有人把它和IIS整合,也有人和Apache

通过AppCmd.exe实现ISAPI 筛选器的添加代码_win服务器

若要添加 ISAPI 筛选器,请使用以下语法: appcmd set config /section:isapiFilters /+[name=' string ',path=' string ',enabled='true |false',enableCache='true |false',preCondition=' string '] 变量 name string 是要添加的 ISAPI 筛选器的名称.变量 path string 是 ISAPI 筛选器的 .dll 文件的物理 path