rewrite

在对应的文件下 .htaccess文件

<IfModule rewrite_module>

#如果rewrite 模块启用

#配置我们的rewrite规则

RewriteEngine On

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

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

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

#如果是在后面因为,则使用$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生成器

原文地址:https://www.cnblogs.com/jiaoaozuoziji/p/8124577.html