rewrite

在对应的文件下 .htaccess文件

<IfModule rewrite_module>

#如果rewrite 模块启用

#配置我们的rewrite规则

RewriteEngine On

#rewrite的规则 如果 aaa.html 就跳转到news.php

#$1 表示反向引用,第一个子表达式的内容

#说明如果在正则规范中直接引用子表达式的内容,则使用\n

#如果是在后面因为,则使用$n

RewriteRule news-([a-zA-Z]+)-id(\d+)\.html$  news.php?type=$1&id=$2

#RewriteRule aaa.html  news.php

</IfModule>

 

http://www.bm8.com.cn/webtool/htaccess/    rewrite生成器

 

posted on 2017-12-27 10:41  骄傲做自己  阅读(266)  评论(1编辑  收藏  举报

导航