Menu

SEO中如何在IIS环境下对REWRITE规则进行读写操作?

  • 软文     2019-5-22
<返回列表

代码SEO中,如何在IIS环境下对REWRITE规则进行读写操作?

URL 静态化可以提高搜索引擎抓取,开启本功能需要对 Web 服务器增加相应的 Rewrite 规则,且会轻微增加服务器负担。本教程讲解如何在 IIS 环境下配置各个产品的 Rewrite 规则。

一、首先下载 Rewrite.zip 的包,解压到任意盘上的任意目录。

各个产品的 Rewrite 规则包不同,请选择对应的产品下载对应的Rewrite规则。

Discuz!6.0.0/6.1.0 的 Rewrite 规则下载:Rewrite.zip

UCenter Home1.0.0 的 Rewrite规则下载:Rewrite.zip

SupeSite6.0_X-Space4.0_UC 的Rewrite 规则下载:iisrewrite.zip

SupeV 的 Rewrite 规则下载:rewrite_iis.zip

二、配置方法

Discuz!、UCHome、SupeSite/X-Space、SupeV 的 Rewrite 配置方法类似,下面以 Discuz!6.0.0/6.1.0 的 Rewrite 规则配置方法为例讲解如何在 IIS 环境下配置 Rewrite 规则。

httpd.ini 文件内容如下配置

[ISAPI_Rewrite]

# 3600 = 1 hour

CacheClockRate 3600

RepeatLimit 32

# Discuz! Rewrite规则

# 独立主机用户

# Protect httpd.ini and httpd.parse.errors files

# from accessing through HTTP

RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)\?*(.*)$ $1/archiver

/index\.php\?$2&$4

RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forumdisplay

\.php\?fid=$2&page=$3&$4

RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1

/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3&$4

RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/space

\.php\?$2=$3&$4

RewriteRule ^(.*)/tag-(.+)\.html\?*(.*)$ $1/tag\.php\?name=$2&$3

# SupeSite Rewrite规则

# 独立主机用户

# 修改以下语句中的 /supesite 修改为你的SupeSite目录地址,如果程序放在根目录中,

请将 /supesite 修改为 /

RewriteRule ^/supesite/([0-9]+)$ /supesite/index\.php\?uid/$1 [L]

RewriteRule ^/supesite/([0-9]+)/spacelist(.+)$ /supesite/index

\.php\?uid/$1/action/spacelist/type$2 [L]

RewriteRule ^/supesite/([0-9]+)/viewspace(.+)$ /supesite/index

\.php\?uid/$1/action/viewspace/itemid$2 [L]

RewriteRule ^/supesite/([0-9]+)/viewbbs(.+)$ /supesite/index

\.php\?uid/$1/action/viewbbs/tid$2 [L]

RewriteRule ^/supesite/([0-9]+)/(.*)$ /supesite/index

\.php\?uid/$1/$2 [L]

RewriteRule ^/supesite/action(.+)$ /supesite/index

\.php\?action$1 [L]

RewriteRule ^/supesite/category(.+)$ /supesite/index

\.php\?action/category/catid$1 [L]

RewriteRule ^/supesite/viewnews(.+)$ /supesite/index

\.php\?action/viewnews/itemid$1 [L]

RewriteRule ^/supesite/viewthread(.+)$ /supesite/index

\.php\?action/viewthread/tid$1 [L]

RewriteRule ^/supesite/mygroup(.+)$ /supesite/index

\.php\?action/mygroup/gid$1 [L]

# UCHome Rewrite规则

# 独立主机用户

# 修改以下语句中的 /uchome 修改为你的uchome目录地址,如果程序放在根目录中,

请将 /uchome 修改为 /

RewriteRule ^/uchome/(space|network)-(.+)\.html$ /uchome/$1\.php\?rewrite=$2 [L]

RewriteRule ^/uchome/(space|network)\.html$ /uchome/$1\.php [L]

RewriteRule ^/uchome/([0-9]+)$ /uchome/space\.php\?uid=$1 [L]

# SupeV Rewrite规则

# 独立主机用户

RewriteRule ^(.*)/ivideo(-tv-([0-9]+))?(-ti-([0-9]+))?(-tc-([0-9]+))

?(-page-([0-9]+))?\.html$ $1/ivideo\.php\?tv=$3&ti=$5&tc=$7&page=$9

RewriteRule ^(.*)/ispecial(-tv-([0-9]+))?(-ti-([0-9]+))?(-tc-([0-9]+))

?(-page-([0-9]+))?\.html$ $1/ispecial\.php\?tv=$3&ti=$5&tc=$7&page=$9

RewriteRule ^(.*)/icategory\.html$ $1/icategory\.php

RewriteRule ^(.*)/category-cid-([0-9]+)(-tag-([^-]*))?(-timelimit-([0-9]+))

?(-orderlimit-([0-9]+))?(-page-([0-9]+))?\.html$ $1/category\.php\

?cid=$2&tag=$4&timelimit=$6&orderlimit=$8&page=$10

RewriteRule ^(.*)/vspace-(mid|username)-(.+)\.html$ $1/vspace\.php\?$2=$3

RewriteRule ^(.*)/video-(vid|ivid)-(.+)\.html$ $1/video\.php\?$2=$3

RewriteRule ^(.*)/special-spid-([0-9]+)\.html$ $1/special\.php\?spid=$2

以上就是如何在IIS环境下配置Rewrite规则的主要内容,希望对你有帮助!另外关于在Apache环境配置URL重写请学习:如何在Apache环境下配置Rewrite规则

原文出自:http://www.wosuosu.com/a/news/bzzx/81.html

沃索苏SEO专注企业SEO服务和SEO优化,网站优化,沃索苏SEM,中国SEO诚信服务品牌。

本文由广州沃索苏信息科技有限公司保留所有,转载请以连接形式注明出处。


更多阅读

直击泛家居产行业20强的品牌定位策略

软文 2019-5-22
大材研究注意到,近几年来,有不少公司重塑定位,或者放大原来的优势定位。此事,如果做好了,少则省几千万,多则可省几个亿的广告费。 ...

卖家成长 选取关键词得注意 前期关键词调研更重要

软文 2019-5-22
如今在亚马逊上开个店看似很容易,但要保证出单,持续的出单却很难。原因有很多,老话说的没错,三分靠运气七分靠打拼,而做亚马逊前期...

国庆假期借势海报 杜蕾斯发挥正常 宝马海报无文案 ofo大手笔

软文 2019-5-22
文 | PR天下 今年国庆假期与去年最大不一样的地方在于,期间还要累加一天中秋节假期,共计八天,而这竟成为数家品牌借势创意的发力点。...
返回列表
扫描二维码分享到微信
确 认

Copyright © 2015-2021 发稿网

     
扫码二维码立即咨询
确 认