URL重写(伪静态)指南

字体:

 

在开启URL重写之前请先确认您的主机所使用的服务器软件(如果不知道使用的是什么软件,请咨询主机提供商).

下面按照服务器软件,进行介绍.

1.apache

如果服务器软件为apache,直接进入后台,点击导航里面的,网站设置,然后点击URL重写,再选择开启URL重写,提交以后,就可以了.

如果不能正常生成.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;

 

 

上一篇:fun88登录程序介绍

下一篇:fun88登录安装指南

 

最新文章

相关文章