WeCenter各种环境伪静态规则大全

君笑尘
君笑尘 这家伙很懒,还没有设置简介

0 人点赞了该文章 · 3052 浏览

WeCenter各种环境伪静态配置大全

.htaccess 伪静态规则、httpd.ini伪静态规则、ii7和ii8及以上web.config伪静态规则

WeCenter .htaccess 伪静态代码:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


WeCenter httpd.ini伪静态代码:

CacheClockRate 3600
RepeatLimit 32
RewriteBase /
RewriteRule /static/(.) /static/$1
RewriteRule /uploads/(.) /uploads/$1
RewriteRule /(.*) /index.php/$1

IIS8.0伪静态代码(完整web.config文件区别代码):

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WeCenter" patternSyntax="Wildcard">
<match url="*"/>
<conditions>
<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>


根据你需求取舍伪静态代码。

iiS7.0以上(WeCenter web.config)伪静态代码:

<rule name="Static" stopProcessing="true">
<match url="^static/(.*)$" />
<action type="Rewrite" url="static/{R:1}" />
</rule>
<rule name="Uploads" stopProcessing="true">
<match url="^uploads/(.*)$" />
<action type="Rewrite" url="uploads/{R:1}" />
</rule>
<rule name="site" stopProcessing="true">
<match url="^(.*)$" />
<action type="Rewrite" url="index.php?/{R:1}" appendQueryString="true" logRewrittenUrl="true" />
</rule>
<rule name="cnUrl ht" stopProcessing="true">
<match url="^topic/(.*)$" />
<action type="Rewrite" url="cnurl.php" />
</rule>


发布于 2020-04-08 11:04

免责声明:

本文由 君笑尘 原创发布于 WeCenter ,著作权归作者所有。

登录一下,更多精彩内容等你发现,贡献精彩回答,参与评论互动

登录! 还没有账号?去注册

君笑尘
2020-04-08 11:17
XXS过滤了,排版有问题