新闻中心

易企cms伪静态设置教程

作者 / 无忧主机 时间 2015-05-29 23:02:24

伪静态这个定义站长朋友都应该是非常熟悉的,那么问题来了,好多站长朋友在php空间设置易企cms的时候不会,居然说没有成功,那么问题会出现在哪里呢,绝大部分的站长朋友认为在后台设置,就可以正常的实现了,那么问题来了,打开链接报错404错误,那么意思就是说伪静态的url重定向失败,那么这个原因的导致就是空间里面您没有放入伪静态规则导致的,所以说伪静态规则是非常重要的。今天无忧主机小编就对于无忧主机php空间基础上对易企cms做一下伪静态设置的讲解: 1、首先是登录到我们的后台,然后找到网站设置选线,然后再找到URL重写,然后点击url重定向选择。也就是在开启伪静态的设置。 2、然后就是链接我们的ftp,找到我们站点的根目录。创建一个.htaccess文件前面是一个点哈。然后放入以下规则:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^article\/(.+)\.html$ article.php?name=$1 [L]
RewriteRule ^product\/(.+)\.html$ product.php?name=$1 [L]
RewriteRule ^category\/([^/_]+)[/]?$ category.php?name=$1 [L]
RewriteRule ^category\/([^/]+)_([0-9]+)[/]?$ category.php?name=$1&p=$2 [L]
RewriteRule ^catalog\/([^/]+)[/]?$ catalog.php?type=$1 [L]
RewriteRule ^comment.html$ comment.php [L]
RewriteRule ^sitemap.xml$ sitemap.php [L]
</IfModule>
这个规则是对于apache的伪静态设置。那么很多站长朋友就很奇怪了那么我的是其他的主机怎么办呢:下面无忧主机小编就把对应的伪静态设置简单的公布一下。 1.iis 如果服务器软件为iis,请确保服务端安装过ISAPI_Rewrite组件. 然后联系主机提供商,加入以下规则.
RewriteRule ^/article/(.+)\.html$ /article\.php\?name=$1
RewriteRule ^/product/(.+)\.html$ /product\.php\?name=$1
RewriteRule ^/category/([^/_]+)[/]?$ /category\.php\?name=$1
RewriteRule ^/category/([^/]+)_([0-9]+)[/]?$ /category\.php\?name=$1&p=$2
RewriteRule ^/catalog/([^/]+)[/]?$ /catalog\.php\?type=$1
RewriteRule ^/comment\.html$ /comment\.php
RewriteRule ^/sitemap\.xml$ /sitemap\.php
2.nginx 如果服务器软件为nginx,请联系主机提供商,加入以下规则
rewrite ^/article\/(.+)\.html$ /article.php?name=$1 last;
rewrite ^/product\/(.+)\.html /product.php?name=$1 last;
rewrite ^/category\/([^/]+)_([0-9]+)[/]? /category.php?name=$1&p=$2 last;
rewrite ^/category\/([^/_]+)[/]? /category.php?name=$1 last;
rewrite ^/catalog\/([^/]+)[/]? /catalog.php?type=$1 last;
rewrite ^/comment.html$ /comment.php last;
rewrite ^/sitemap.xml$ /sitemap.php last;
几乎这个程序目前为止,这个程序只给出了这几种的伪静态规则,希望能帮助者到站长朋友们! 无忧主机相关文章推荐阅读: 易企CMS程序介绍

本文地址:https://www.51php.com/yiqicms/19537.html

1
1
1
1
1
1
1

客户服务热线

0791-8623-3537

在线客服