伪静态页
phpok伪静态页规则和wordpress基本上是一样的!如果不会配置规则,把wordpress拿过来,基本上可以用的!
Apache伪静态页配置,在PHPOK根目录入创建 .htaccess 文件,将下面的代码复制进去即可!
- RewriteEngine on
- RewriteBase /
- RewriteRule ^index.php$ - [L]
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^. index.php [L]
IIS7.0+的伪静态页配置,需要在 web.config 下增加下列规则(这里包含默认首页的增加)
- <?xml version="1.0" encoding="UTF-8"?>
- <configuration>
- <system.webServer>
- <defaultDocument>
- <files>
- <clear />
- <add value="index.php" />
- </files>
- </defaultDocument>
- <rewrite>
- <rules>
- <rule name="PHPOK" stopProcessing="true">
- <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/{R:0}" appendQueryString="true" />
- </rule>
- </rules>
- </rewrite>
- </system.webServer>
- </configuration>
Nginx伪静态页规则请写在 localhost /{……….} 里来,代码如下:
- if (!-f $request_filename){
- set $rule_0 1$rule_0;
- }
- if (!-d $request_filename){
- set $rule_0 2$rule_0;
- }
- if ($uri !~ "=/favicon.ico"){
- set $rule_0 3$rule_0;
- }
- if ($rule_0 = "321"){
- rewrite ^/ /index.php last;
- }