destoon之URL Rewrite(伪静态)设置方法详解
php  /  管理员 发布于 8年前   188
1、如果您的服务器支持.htaccess,则无需设置,网站根目录下的.htaccess已经设置好规则。 2、如果是Apache服务器: Apache 1.x 的用户请检查 conf/httpd.conf 中是否存在如下两段代码: Apache 2.x 的用户请检查 conf/httpd.conf 中是否存在如下一段代码: 如果存在,且以#开头,请删除#。然后在配置文件(通常就是 conf/httpd.conf或者conf/extra/httpd-vhosts.conf)中加入如下代码。 Apache conf文件配置(参考http://download.destoon.com/rewrite/apache.txt)规则: 3、Nginx规则(参考http://download.destoon.com/rewrite/nginx.txt): 4、Zeus规则(参考http://download.destoon.com/rewrite/zeus.txt): 5、IIS6服务器 请下载 http://download.destoon.com/rewrite/IIS_Rewrite.zip 6、IIS7服务器 规则(参考http://download.destoon.com/rewrite/web.config.txt)为: 然后进入各模块的模块设置“SEO设置”选择对应伪静态地址规则 选择“更新地址”提交即可。
规则(参考http://download.destoon.com/rewrite/htaccess.txt)为:# Destoon B2B Rewrite RulesErrorDocument 404 /404.phpRewriteEngine OnRewriteBase /RewriteRule ^(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$ /404.phpRewriteRule ^(.*)/file/(.*)\.php(.*)$ /404.phpRewriteRule ^(.*)-htm-(.*)$ $1.php?$2RewriteRule ^(.*)/show-([0-9]+)([\-])?([0-9]+)?\.html$ $1/show.php?itemid=$2&page=$4RewriteRule ^(.*)/list-([0-9]+)([\-])?([0-9]+)?\.html$ $1/list.php?catid=$2&page=$4RewriteRule ^(.*)/show/([0-9]+)/([0-9]+)?([/])?$ $1/show.php?itemid=$2&page=$3RewriteRule ^(.*)/list/([0-9]+)/([0-9]+)?([/])?$ $1/list.php?catid=$2&page=$3RewriteRule ^(.*)/([A-za-z0-9_\-]+)-c([0-9]+)-([0-9]+)\.html$ $1/list.php?catid=$3&page=$4RewriteRule ^(.*)/([a-z]+)/(.*)\.shtml$ $1/$2/index.php?rewrite=$3RewriteRule ^(com)/([a-z0-9_\-]+)/([a-z]+)/(.*)\.html$ index.php?homepage=$2&file=$3&rewrite=$4RewriteRule ^(com)/([a-z0-9_\-]+)/([a-z]+)([/])?$ index.php?homepage=$2&file=$3RewriteRule ^(com)/([a-z0-9_\-]+)([/])?$ index.php?homepage=$2
LoadModule rewrite_module libexec/mod_rewrite.soAddModule mod_rewrite.c
LoadModule rewrite_module modules/mod_rewrite.so
此时请务必注意,如果网站使用通过虚拟主机来定义,请务必加到虚拟主机配置,即# Destoon B2B Rewrite RulesErrorDocument 404 /404.phpRewriteEngine OnRewriteBase /RewriteRule ^(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$ /404.phpRewriteRule ^(.*)/file/(.*)\.php(.*)$ /404.phpRewriteRule ^(.*)-htm-(.*)$ $1.php?$2RewriteRule ^(.*)/show-([0-9]+)([\-])?([0-9]+)?\.html$ $1/show.php?itemid=$2&page=$4RewriteRule ^(.*)/list-([0-9]+)([\-])?([0-9]+)?\.html$ $1/list.php?catid=$2&page=$4RewriteRule ^(.*)/show/([0-9]+)/([0-9]+)?([/])?$ $1/show.php?itemid=$2&page=$3RewriteRule ^(.*)/list/([0-9]+)/([0-9]+)?([/])?$ $1/list.php?catid=$2&page=$3RewriteRule ^(.*)/([A-za-z0-9_\-]+)-c([0-9]+)-([0-9]+)\.html$ $1/list.php?catid=$3&page=$4RewriteRule ^(.*)/([a-z]+)/(.*)\.shtml$ $1/$2/index.php?rewrite=$3RewriteRule ^(.*)/com/([a-z0-9_\-]+)/([a-z]+)/(.*)\.html$ $1/index.php?homepage=$2&file=$3&rewrite=$4RewriteRule ^(.*)/com/([a-z0-9_\-]+)/([a-z]+)([/])?$ $1/index.php?homepage=$2&file=$3RewriteRule ^(.*)/com/([a-z0-9_\-]+)([/])?$ $1/index.php?homepage=$2
rewrite ^/(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$ /404.php last;rewrite ^/(.*)/file/(.*)\.php(.*)$ /404.php last;rewrite ^/(.*)-htm-(.*)$ /$1.php?$2 last;rewrite ^/(.*)/show-([0-9]+)([\-])?([0-9]+)?\.html$ /$1/show.php?itemid=$2&page=$4 last;rewrite ^/(.*)/list-([0-9]+)([\-])?([0-9]+)?\.html$ /$1/list.php?catid=$2&page=$4 last;rewrite ^/(.*)/show/([0-9]+)/([0-9]+)?([/])?$ /$1/show.php?itemid=$2&page=$3 last;rewrite ^/(.*)/list/([0-9]+)/([0-9]+)?([/])?$ /$1/list.php?catid=$2&page=$3 last;rewrite ^/(.*)/([A-za-z0-9_\-]+)-c([0-9]+)-([0-9]+)\.html$ /$1/list.php?catid=$3&page=$4 last;rewrite ^(.*)/([a-z]+)/(.*)\.shtml$ $1/$2/index.php?rewrite=$3 last;rewrite ^/(com)/([a-z0-9_\-]+)/([a-z]+)/(.*)\.html$ /index.php?homepage=$2&file=$3&rewrite=$4 last;rewrite ^/(com)/([a-z0-9_\-]+)/([a-z]+)([/])?$ /index.php?homepage=$2&file=$3 last;rewrite ^/(com)/([a-z0-9_\-]+)([/])?$ /index.php?homepage=$2 last;
match URL into $ with ^(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$ if matched then set URL = /404.phpendifmatch URL into $ with ^(.*)/file/(.*)\.php(.*)$ if matched then set URL = /404.phpendifmatch URL into $ with ^(.*)-htm-(.*)$ if matched then set URL = $1.php?$2 endifmatch URL into $ with ^(.*)/show-([0-9]+)([\-])?([0-9]+)?\.html$ if matched then set URL = $1/show.php?itemid=$2&page=$4 endifmatch URL into $ with ^(.*)/list-([0-9]+)([\-])?([0-9]+)?\.html$ if matched then set URL = $1/list.php?catid=$2&page=$4 endifmatch URL into $ with ^(.*)/show/([0-9]+)/([0-9]+)?([/])?$ if matched then set URL = $1/show.php?itemid=$2&page=$3 endifmatch URL into $ with ^(.*)/list/([0-9]+)/([0-9]+)?([/])?$ if matched then set URL = $1/list.php?catid=$2&page=$3 endifmatch URL into $ with ^(.*)/([A-za-z0-9_\-]+)-c([0-9]+)-([0-9]+)\.html$if matched then set URL = $1/list.php?catid=$3&page=$4endifmatch URL into $ with ^(.*)/([a-z]+)/(.*)\.shtml$ if matched then set URL = $1/$2/index.php?rewrite=$3 endifmatch URL into $ with ^(.*)/com/([a-z0-9_\-]+)/([a-z]+)/(.*)\.html$ if matched then set URL = $1/index.php?homepage=$2&file=$3&rewrite=$4 endifmatch URL into $ with ^(.*)/com/([a-z0-9_\-]+)/([a-z]+)([/])?$ if matched then set URL = $1/index.php?homepage=$2&file=$3 endifmatch URL into $ with ^(.*)/com/([a-z0-9_\-]+)([/])?$ if matched then set URL = $1/index.php?homepage=$2 endif
规则已经设置好,按readme.txt文件内容进行操作
如果网站支持httpd.ini文件,请使用如下规则(参考http://download.destoon.com/rewrite/httpd.ini):[ISAPI_Rewrite]# Destoon B2B www.destoon.com# 3600 = 1 hourCacheClockRate 3600RepeatLimit 32# Protect httpd.ini and httpd.parse.errors files# from accessing through HTTPRewriteRule ^(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$ /404\.phpRewriteRule ^(.*)/file/(.*)\.php(.*)$ /404\.phpRewriteRule ^(.*)-htm-(.*)$ $1\.php\?$2RewriteRule ^(.*)/show-([0-9]+)([\-])?([0-9]+)?\.html$ $1/show\.php\?itemid=$2&page=$4RewriteRule ^(.*)/list-([0-9]+)([\-])?([0-9]+)?\.html$ $1/list\.php\?catid=$2&page=$4RewriteRule ^(.*)/show/([0-9]+)/([0-9]+)?([/])?$ $1/show\.php\?itemid=$2&page=$3RewriteRule ^(.*)/list/([0-9]+)/([0-9]+)?([/])?$ $1/list\.php\?catid=$2&page=$3RewriteRule ^(.*)/([A-za-z0-9_\-]+)-c([0-9]+)-([0-9]+)\.html$ $1/list\.php\?catid=$3&page=$4RewriteRule ^(.*)/com/([a-z0-9_\-]+)/([a-z]+)/(.*)\.html$ $1/index\.php\?homepage=$2&file=$3&rewrite=$4RewriteRule ^(.*)/com/([a-z0-9_\-]+)/([a-z]+)([/])?$ $1/index\.php\?homepage=$2&file=$3RewriteRule ^(.*)/com/([a-z0-9_\-]+)([/])?$ $1/index\.php\?homepage=$2RewriteRule ^(.*)/([a-z]+)/(.*)\.shtml$ $1/$2/index\.php\?rewrite=$3
Rewrite生效后,请在网站后台=》网站设置=》SEO优化=》URL Rewrite,选择“开启”提交。您可能感兴趣的文章:
122 在
学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..博主 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..1111 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号