随身笔记
随身笔记

wordpress在IIS8.0伪静态设置(httpd.ini转成web.config伪静态)

很多站长都在IIS6.0发布网站要让网站支持伪静态只需要修改httpd.ini就可以简单实现:

[code]RegistrationName= wlqcwin
RegistrationCode= 2EAD-35GH-66NN-ZYBA

[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32

#默认包含了301设置,此设置情况下cctv.com/aa.htm 会301跳至www.cctv.com/aa.htm,将cctv.com替换为您自己的域名就能实现自己的域名的301
RewriteCond %{HTTP:Host} ^xgllseo.com$
RewriteRule (.*) https://sdeno.com$1 [NC,R=301]

 

#Discuz ! x和discuz x1.5伪静态规则,若不需要或与您的网站程序有冲突可以删除。
#如果你的网站是discuz!x就把以下几行前面的#号删除,然后把duoduo 淘宝客 以下的规则全部删除,二者有冲途!
#RewriteRule ^(.*)/topic-(.+)\.html\?*(.*)$ $1/portal\.php\?mod=topic&topic=$2&$3
#RewriteRule ^(.*)/article-([0-9]+)\.html\?*(.*)$ $1/portal\.php\?mod=article&articleid=$2&$3
#RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$4
#RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$5
#RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=group&fid=$2&page=$3&$4
#RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/home\.php\?mod=space&$2=$3&$4
#RewriteRule ^(.*)/([a-z]+)-(.+)\.html\?*(.*)$ $1/$2\.php\?rewrite=$3&$4

# duoduo 淘宝客 Rewrite规则
RewriteRule ^/index\.html$ /index\.php
RewriteRule /sitemap_baidu.xml /sitemap_baidu.xml [L]
RewriteRule /sitemap.html /sitemap.html [L]
RewriteRule ^/malllist\.html$ /malllist\.php
RewriteRule ^/shoplist\.html$ /shoplist\.php
RewriteRule ^/article\.html$ /article\.php
RewriteRule ^/user/center\.html$ /user/center\.php
RewriteRule ^/mall-(.*)-(.*)-(.*)\.html$ /mall\.php\?id=$1&act=$2&page=$3
RewriteRule ^/mall-(.*)-(.*)\.html$ /mall\.php\?id=$1&act=$2
RewriteRule ^/mall-(.*)\.html$ /mall\.php\?id=$1
RewriteRule ^/view-(.*)-(.*)\.html$ /view\.php\?iid=$1&page=$2
RewriteRule ^/view-(.*)\.html$ /view\.php\?iid=$1
RewriteRule ^/malllist-(.*)-(.*)-(.*)\.html$ /malllist\.php\?catid=$1&mall=$2&page=$3
RewriteRule ^/article_list-(.*)-(.*)\.html$ /article_list\.php\?cid=$1&page=$2
RewriteRule ^/article_list-(.*)\.html$ /article_list\.php\?cid=$1
RewriteRule ^/read-(.*)\.html$ /read\.php\?id=$1
RewriteRule ^/list-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$ /list\.php\?cid=$1&start_price=$2&end_price=$3&sort=$4&area=$5&guarantee=$6&list=$7&q=$8&page=$9
RewriteRule ^/shop-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$ /shop\.php\?nick=$1&start_price=$2&end_price=$3&sort=$4&area=$5&guarantee=$6&list=$7&q=$8&page=$9 [NU]
RewriteRule ^/shoplist-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$ /shoplist\.php\?cid=$1&keyword=$2&start_level=$3&end_level=$4&area=$5&px=$6&cpr=$7&type=$8&page=$9 [NU]
RewriteRule ^/shoplist-(.*)\.html$ /shoplist\.php\?cid=$1
RewriteRule ^/shop-(.*)\.html$ /shop\.php\?nick=$1 [NU]
RewriteRule ^/list-(.*)\.html$ /list\.php\?cid=$1
RewriteRule ^/list\.html$ /list\.php
RewriteRule ^/huangou-(.*)\.html$ /huangou\.php\?id=$1
RewriteRule ^/huan-(.*)-(.*)\.html$ /huan\.php\?keyword=$1&page=$2 [NU]
RewriteRule ^/huan\.html$ /huan\.php
RewriteRule ^/coupons-(.*)-(.*)\.html$ /coupons\.php\?cid=$1&page=$2
RewriteRule ^/coupons\.html$ /coupons\.php
RewriteRule ^/cuxiao-(.*)\.html$ /cuxiao\.php\?id=$1
RewriteRule ^/tg-(.*)-(.*)-(.*)-(.*)-(.*)\.html$ /tg\.php\?city_id=$1&catid=$2&mallid=$3&keyword=$4&page=$5 [NU]
RewriteRule ^/tg-(.*)-(.*)-(.*)-(.*)\.html$ /tg\.php\?city_id=$1&catid=$2&mallid=$3&page=$4
RewriteRule ^/tg-(.*)-(.*)-(.*)\.html$ /tg\.php\?city_id=$1&catid=$2&mallid=$3
RewriteRule ^/tg-(.*)\.html$ /tg\.php\?city_id=$1
RewriteRule ^/tg\.html$ /tg\.php
RewriteRule ^/tgview-(.*)\.html$ /tgview\.php\?id=$1
RewriteRule /news/(.*) /news/$1 [L][/code]
以上是小编现有的博客httpd.ini规则,通常情况下都是:

[code][ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
RewriteRule ^/index\.html$ /index\.php [N,I]
RewriteRule ^(.*)/index\.html $1/index\.php [I]
RewriteRule ^(.*)/page([0-9]+)\.html $1/index\.php\?gid=$2 [I]
RewriteRule ^(.*)/list-([0-9]+)\.html $1/index\.php\?PageNo=$2 [I]
RewriteRule ^(.*)/show-aid([0-9]+)\.html $1/show\.php\?uid=$2 [I][/code]
现在由于IIS8.0只支持web.config所以我们将以上的代码转化为:

[code]<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=”.bat” mimeType=”text/bath” />
</staticContent>
<rewrite>
<rules>
<rule name=”home Index”>
<match url=”^index.html$” ignoreCase=”false” />
<action type=”Rewrite” url=”index.php” appendQueryString=”false” />
</rule>
<rule name=”page Index”>
<match url=”^(.*)/index.html$” ignoreCase=”false” />
<action type=”Rewrite” url=”{R:1}/index.php” appendQueryString=”false” />
</rule>
<rule name=”page List”>
<match url=”^(.*)page([0-9]+).html$” ignoreCase=”false” />
<action type=”Rewrite” url=”{R:1}/index.php?gid={R:2}” appendQueryString=”false” />
</rule>
<rule name=”list Page”>
<match url=”^(.*)list-([0-9]+).html$” ignoreCase=”false” />
<action type=”Rewrite” url=”{R:1}/.php?PageNo={R:2}” appendQueryString=”false” />
</rule>
<rule name=”show Page”>
<match url=”^(.*)show-aid([0-9]+).html$” ignoreCase=”false” />
<action type=”Rewrite” url=”{R:1}/show.php?uid={R:2}” appendQueryString=”false” />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>[/code]

没有标签
首页      前端资源      wordpress教程      wordpress在IIS8.0伪静态设置(httpd.ini转成web.config伪静态)

随身笔记

wordpress在IIS8.0伪静态设置(httpd.ini转成web.config伪静态)
很多站长都在IIS6.0发布网站要让网站支持伪静态只需要修改httpd.ini就可以简单实现: [code]RegistrationName= wlqcwin RegistrationCode= 2EAD-35GH-66NN-ZYBA [ISAPI_Rewrite] …
扫描二维码继续阅读
2013-10-15