[TOC]
# WeCenter各种环境伪静态大全[官方简洁版]
*****
WeCenter各种环境伪静态大全\[官方简洁版\]包括了ii7/ii8及以上web.config伪静态规则、.htaccess 伪静态规则、httpd.ini伪静态规则大全完整版。
## **Linux Nginx环境**
**宝塔Linux Nginx环境**
WeCenter伪静态规则代码
```
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
```
## **apache服务器环境**
**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]
#增加如下内容
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
</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服务器环境**
**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>
~~~
本文转载自:[https://www.css5.com.cn/article/1189.shtml](https://www.css5.com.cn/article/1189.shtml)
以上部分内容是根据自己的实际情况,略有修改
# 网站后台开启伪静态
*****
注意!
>
> 请先在服务器上完成伪静态的配置,
> 请先在服务器上完成伪静态的配置,
> 请先在服务器上完成伪静态的配置,
再到网站后台开启伪静态!!!
![](https://img.kancloud.cn/81/2c/812c1d65b8bf7b37ca6efdc71aabbe16_1830x1046.png)