.htaccess 怎么重写规则?????可以做到吗?

2016-07-07 15:22 来源:www.chinab4c.com 作者:ecshop专家



如这段:
RewriteRule ^goods-([0-9]+)(.*)\.html$goods\.php\?id=$1 [QSA,L]

RewriteRule ^article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$article_cat\.php\?id=$1&page=$2&sort=$3&order=$4[QSA,L]
RewriteRule ^article_cat-([0-9]+)-([0-9]+)-(.+)(.*)\.html$article_cat\.php\?id=$1&page=$2&keywords=$3 [QSA,L]
RewriteRule ^article_cat-([0-9]+)-([0-9]+)(.*)\.html$ article_cat\.php\?id=$1&page=$2[QSA,L]
RewriteRule ^article_cat-([0-9]+)(.*)\.html$ article_cat\.php\?id=$1[QSA,L]

RewriteRule ^article-([0-9]+)(.*)\.html$article\.php\?id=$1[QSA,L]


======================================================
RewriteRule ^article-([0-9]+)(.*)\.html$article\.php\?id=$1[QSA,L]

这个能改成:RewriteRule ^wenzhang-([0-9]+)(.*)\.html$wenzhang\.php\?id=$1[QSA,L]


这个样子吗?我试了下 不可以。请问 怎么改这个规则????
文章的为静态的 连接是:
http://www.shop.com/article-7.html
换成:
http://www.shop.com/wenzhang-7.html

这样的自定义前面的名字 能否做到???

回答:
为静态除了改这个 还要修改对应的php文件哦

要实现楼主的样子,需要修改程序,不光要修改规则,是个大工程啊

关注.................................

修改includes/lib_common.php 1692行article改为你想要的即可

$uri = $rewrite ? 'article-' . $aid : 'article.php?id=' . $aid;

学习了~~~