新闻帮助

你的位置:首页

如何设置rewrite伪静态?

 时间:2018/9/22 10:52:38 
先建立一个文本文件,打开,然后把下面代码复制到刚建立的文本当中:   <?xmlversion="1.0"encoding="UTF-8"?><configuration><system.webServer><rewrite><rules><rulename="destoon_rewrite_0"><matchurl="^(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$"/><actiontype="Rewrite"url="/404.php"/></rule><rulename="destoon_rewrite_1"><matchurl="^(.*)/file/(.*)\.php(.*)$"/><actiontype="Rewrite"url="/404.php"/></rule><rulename="destoon_rewrite_2"><matchurl="^(.*)-htm-(.*)$"/><actiontype="Rewrite"url="{R:1}.php?{R:2}"/></rule><rulename="destoon_rewrite_3"><matchurl="^(.*)/show-([0-9]+)([\-])?([0-9]+)?\.html$"/><actiontype="Rewrite"url="{R:1}/show.php?itemid={R:2}&amp;page={R:4}"/></rule><rulename="destoon_rewrite_4"><matchurl="^(.*)/list-([0-9]+)([\-])?([0-9]+)?\.html$"/><actiontype="Rewrite"url="{R:1}/list.php?catid={R:2}&amp;page={R:4}"/></rule><rulename="destoon_rewrite_5"><matchurl="^(.*)/show/([0-9]+)/([0-9]+)?([/])?$"/><actiontype="Rewrite"url="{R:1}/show.php?itemid={R:2}&amp;page={R:3}"/></rule><rulename="destoon_rewrite_6"><matchurl="^(.*)/list/([0-9]+)/([0-9]+)?([/])?$"/><actiontype="Rewrite"url="{R:1}/list.php?catid={R:2}&amp;page={R:3}"/></rule><rulename="destoon_rewrite_7"><matchurl="^(.*)/([A-za-z0-9_\-]+)-c([0-9]+)-([0-9]+)\.html$"/><actiontype="Rewrite"url="{R:1}/list.php?catid={R:3}&amp;page={R:4}"/></rule><rulename="destoon_rewrite_8"><matchurl="^(com)/([a-z0-9_\-]+)/([a-z]+)/(.*)\.html$"/><actiontype="Rewrite"url="index.php?homepage={R:2}&amp;file={R:3}&amp;rewrite={R:4}"/></rule><rulename="destoon_rewrite_9"><matchurl="^(com)/([a-z0-9_\-]+)/([a-z]+)([/])?$"/><actiontype="Rewrite"url="index.php?homepage={R:2}&amp;file={R:3}"/></rule><rulename="destoon_rewrite_10"><matchurl="^(com)/([a-z0-9_\-]+)([/])?$"/><actiontype="Rewrite"url="index.php?homepage={R:2}"/></rule><rulename="destoon_rewrite_11"><matchurl="^([a-z]+)/(.*)\.shtml$"/><actiontype="Rewrite"url="{R:1}/index.php?rewrite={R:2}"/></rule></rules></rewrite></system.webServer>好http://www.gepunet.com/yanwo/index.html
  好http://www.gepunet.com/yanwo/index.html


  粘贴完成后,保存文件,再把文件名改成“web.config.txt”,上传至网站的根目录。检查一下网站根目录下是否有这个文件“.htaccess”,应该把他删除掉。

【收藏此页】【打印】【关闭】