URL重写

选中相应的选项(开启/关闭url重写)然后点击提交可以实现网站是否应用伪静态功能!

开启URL重写网站的网址会以静态网址的方式显示如:https://wwww.abc.com/abc/abc.html;
关闭URL重写的话,网址会以动态地址显示,例如:https://www.abc.com/abc.php?type=abc。

URL重写与空间接的服务器环境有关系,以下是开启伪静态的具体步骤:
在开启URL重写之前请先确认您的主机所使用的服务器软件(如果不知道使用的是什么软件,请咨询主机提供商),然后根据服务器软件进行选择。

下面按照服务器软件,进行介绍.
1.apache
如果服务器软件为apache,直接进入后台,点击导航里面的,网站设置,然后点击URL重写,再选择开启URL重写,提交以后,就可以了.
可能出现的错误:如果开启后页面一直打不开,可能是主机商没有开启rewrite_mod,请联系主机商开启此功能。
如果不能正常生成.htaccess到根目录,请点此下载https://www.y61pc.com/htaccess.txt,下载完成后将htaccess.txt上传至服务器根目录,然后重命名为.htaccess即可。
2.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
也可以下载此文件:https://www.y61pc.com/httpd.ini
如果现有组件不可用,请下载此组件:https://down.y61pc.com/files/ISAPI_Rewrite.rar
3.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;

其他类型重写规则稍后会陆续添加。。。