当前位置:首页 > 建站教程 > yzmcms教程>正文

YzmCMS伪静态如何配置

2020-10-24 20:18:13 分类: yzmcms教程 阅读(1636) 评论(12)

YzmCMS各环境配置方法,主要是三种,Apache、nignx、IIS,下面是具体的配置代码。

Apache伪静态(即YzmCMS自带的.htaccess文件)

   Options +FollowSymlinks -Multiviews
  RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]

Nginx伪静态:

location / {
	#//...省略部分代码
	if (!-e $request_filename){
		rewrite  ^(.*)$  /index.php?s=$1  last;   break;
	}
}

如果你的应用安装在二级目录,Nginx的伪静态方法设置如下,其中youdomain是所在的目录名称。

location /youdomain/ {
    if (!-e $request_filename){
        rewrite  ^/youdomain/(.*)$  /youdomain/index.php?s=$1  last;
    }
}

IIS伪静态:

在IIS的高版本下面可以配置web.config,在中间添加rewrite节点:

<rewrite>
 <rules>
 <rule name="OrgPage" stopProcessing="true">
 <match url="^(.*)$" />
 <conditions logicalGrouping="MatchAll">
 <add input="{HTTP_HOST}" pattern="^(.*)$" />
 <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
 <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
 </conditions>
 <action type="Rewrite" url="index.php?s={R:1}" />
 </rule>
 </rules>
</rewrite>


以上就是YzmCMS伪静态配置方法的全部内容了。

标签: YzmCMS 伪静态

上一篇

已经是第一篇