网站运营
位置:首页>> 网站运营>> 没有ISAPI Rewrite FULL照样玩多站点伪静态(2)

没有ISAPI Rewrite FULL照样玩多站点伪静态(2)

 来源:asp之家 发布时间:2010-05-12 20:55:00 

标签:Rewrite,伪静态,isapi

5、重启IIS

6、右键点击IIS管理器左栏“网站” 》“属性”,弹出“网站属性”选项卡,选择“ISAPI筛选器”,查看“IIRF”加载是否成功。若是绿色向上箭头,则表示加载成功。

 

二、规则文件格式基本照搬ISAPI Rewrite,要作修改

RewriteRule [源URL正则条件] [目的URL]
ISAPI Rewrite与IIRF的区别就在[目的URL],ISAPI Rewrite的要转义,而IIRF不用转义。
如果网上有现成的ISAPI Rewrite的规则可以直接复制过来,将[目的URL]中的反斜杠(\)一个个删除就可以用在IIRF中用了。
知道这个之后,你就可以随便在网上与人交流,按ISAPI Rewrite交流,最后把转义符(\)删掉就行了。

 

 

三、日志设置

在IIRF中日志值可以设置为0-5,在规则文件的开头部分有两行设置日志类型
RewriteLog C:\Rewrite\supesite\iirfLog.out (注意要写清楚路径,各站点不同)
RewriteLogLevel 0 (0为不记类,3为一般测试,5为处理故障)
日志的代价高昂,同时不会自动删除文件,日志类型一定要设成0,除非用于检查才能修改为其他值,检查完后一定要改为0,否则日志文件把硬盘占满就麻烦了。
如果日志不为0,筛选器起用后,对应文件夹会产生类似以下的文件,是文本格式的,可以用记事本查看。
iirfLog.out.12345.log

 

 

四、查看配置

在IIRF.ini文件中输入以下配置参数,则可通过浏览器方便查看目前IIRF配置
StatusUrl iirfStatus
StatusInquiry ON
在浏览器中输入http://localhost/iirfstatus,即可查看。

 

 

五、规则文件可随时修改,随时生效!

 

 

六、附上wordpress的IIRF规则

先到wordpress后台设置固定连接为:/post/%post_id%.html
然后在wordpress所在网站的根目录创建(IIRF.ini)文件,并在文件中加入以下规则:

 

以下为引用的内容:
RewriteLogLevel 0 RewriteLog E:\flyingblue\logfiles\IIRFLOG\log StatusUrl iirfStatus StatusInquiry ON RewriteRule /index.html$ /index.php [L] # from accessing through HTTP # # WordPress rewrite rules# # # Below is for permalink like /post/%post_id%.html # # Provided By Sideblue # # URL:http://ivup.cn RewriteCond %{REQUEST_FILENAME} ^wp-content.* RewriteCond %{REQUEST_FILENAME} ^wp-admin.* RewriteCond %{REQUEST_FILENAME} ^wp-include.* RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule /post/tag/(.*) /index.php\?tag=$1 RewriteRule /tag/(.*) /index.php?tag=$1 RewriteRule /(contact|about-copyright|favor|archives|tags|sitemap) /index.php?pagename=$1 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 /author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?author_name=$1&feed=$2 RewriteRule /author/?(.*) /index.php?author_name=$1 RewriteRule /rss.xml /wp-feed.php?feed=rss2 RewriteRule /feed/?$ /wp-feed.php?feed=rss2 RewriteRule /comments/feed/?$ /wp-feed.php?feed=comments-rss2 # 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 RewriteRule /page/(.*)/?s=(.*) /index.php?s=$2&paged=$1 RewriteRule /page/(.*) /index.php?paged=$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 RewriteRule /post/([0-9]+).html/(feed|rdf|rss|rss2|atom) /index.php?feed=rss2&p=$1 RewriteRule /post/([0-9]+).html/trackback /wp-trackback.php?p=$1

欢迎访问我的博客http://ivup.cn


0
投稿

猜你喜欢

手机版 网站运营 asp之家 www.aspxhome.com