免费空间
您的位置:首页 > 免费教程

iis8.5伪静态规则是如何设置的

作者:免费空间 发布时间:2019-05-29

     我们做为站长都知道,动态的网站对于SEO是不太友好的。所以我们就需要把网站转换成静态形式,但是问题来了,我们技术上和以后维护的问题,不可能把网站全部都静态化,所以就出现了伪静态。那么iis8.5伪静态规则你知道是如何设置的吗?下面免费空间小编给大家整理一下iis8.5伪静态规则的代码,详细信息如下:



iis8.5伪静态规则


1、wordpress伪静态规则 


新建web.config文件,添加以下代码,保存后上传到web根目录中() 


<?xml version="1.0" encoding="UTF-8"?>
 <configuration>
 <system.webServer>
 <rewrite>
 <rules>
 <rule name="category">
 <match url="category/?(.*)" />
 <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
 <action type="Rewrite" url="/index.php?category_name={R:1}" appendQueryString="false" logRewrittenUrl="false" />
 </rule>
 <rule name="tags">
 <match url="tag/?(.*)" />
 <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
 <action type="Rewrite" url="index.php?tag={R:1}" />
 </rule>
 <rule name="Main Rule" stopProcessing="true">
 <match url=".*" />
 <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
 <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
 <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
 </conditions>
 <action type="Rewrite" url="index.php/{R:0}" />
 </rule>
 <rule name="wordpress" patternSyntax="Wildcard">
 <match url="*" />
 <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
 <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
 <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
 </conditions>
 <action type="Rewrite" url="index.php" />
 </rule></rules>
 </rewrite>
 </system.webServer>
 </configuration>

 

iis8.5伪静态规则


2.discuss论坛伪静态规则: 


<?xml version="1.0" encoding="UTF-8"?>
 <configuration>
 <system.webServer>
 <rewrite>
 <rules>
 <rule name="portal_topic">
 <match url="^(.*/)*topic-(.+).html\?*(.*)$" />
 <action type="Rewrite" url="{R:1}/portal.php\?mod=topic&amp;topic={R:2}&amp;{R:3}" />
 </rule>
 <rule name="portal_article">
 <match url="^(.*/)*article-([0-9]+)-([0-9]+).html\?*(.*)$" />
 <action type="Rewrite" url="{R:1}/portal.php\?mod=view&amp;aid={R:2}&amp;page={R:3}&amp;{R:4}" />
 </rule>
 <rule name="forum_forumdisplay">
 <match url="^(.*/)*forum-(\w+)-([0-9]+).html\?*(.*)$" />
 <action type="Rewrite" url="{R:1}/forum.php\?mod=forumdisplay&amp;fid={R:2}&amp;page={R:3}&amp;{R:4}" />
 </rule>
 <rule name="forum_viewthread">
 <match url="^(.*/)*thread-([0-9]+)-([0-9]+)-([0-9]+).html\?*(.*)$" />
 <action type="Rewrite" url="{R:1}/forum.php\?mod=viewthread&amp;tid={R:2}&amp;extra=page%3D{R:4}&amp;page={R:3}&amp;{R:5}" />
 </rule>
 <rule name="group_group">
 <match url="^(.*/)*group-([0-9]+)-([0-9]+).html\?*(.*)$" />
 <action type="Rewrite" url="{R:1}/forum.php\?mod=group&amp;fid={R:2}&amp;page={R:3}&amp;{R:4}" />
 </rule>
 <rule name="home_space">
 <match url="^(.*/)*space-(username|uid)-(.+).html\?*(.*)$" />
 <action type="Rewrite" url="{R:1}/home.php\?mod=space&amp;{R:2}={R:3}&amp;{R:4}" />
 </rule>
 <rule name="home_blog">
 <match url="^(.*/)*blog-([0-9]+)-([0-9]+).html\?*(.*)$" />
 <action type="Rewrite" url="{R:1}/home.php\?mod=space&amp;uid={R:2}&amp;do=blog&amp;id={R:3}&amp;{R:4}" />
 </rule>
 <rule name="forum_archiver">
 <match url="^(.*/)*(fid|tid)-([0-9]+).html\?*(.*)$" />
 <action type="Rewrite" url="{R:1}/index.php\?action={R:2}&amp;value={R:3}&amp;{R:4}" />
 </rule>
 </rules>
 </rewrite>
 </system.webServer>
 </configuration>

 


以上就是免费空间小编给大家整理的iis8.5伪静态规则是如何设置的,希望能帮助到你!




标签:   iis8.5伪静态 伪静态规则
阅读全文

上一篇:免费空间如何设置支持MP4文件?

下一篇:如何远程连接Windows服务器

相关推荐
免费空间声明:
(一) 由于各方面情况的调整与变化,本网所提供的考试信息仅供参考,敬请以权威部门公布的正式信息为准。
(二) 本网注明来源为其他媒体的稿件均为转载稿,免费转载出于非商业性学习目的,版权归原作者所有。如有内容、版权等问题请在30日内与本网联系。联系方式:邮件 jiansou123@126.com
网站地图 | XML地图 | PC版
版权所有 © www.128sj.com 免费空间
本网站所有信息全是来源于互联网
如有侵权请来电咨询!
粤ICP备16040413号-1