WeCenter各种环境伪静态规则大全
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:17