Home >Backend Development >PHP Tutorial >求个简单的.htaccess伪静态规则

求个简单的.htaccess伪静态规则

WBOY
WBOYOriginal
2016-06-23 14:20:49950browse

/e/tags/index.php?page=23&tagname=%B9%D8%D3%DA%D3%D1%D2%EA%D5%E4%B9%F3%B5%C4%B8%F1%D1%D4&line=3&tempid=13

当page不是0的时候伪静态成
/tag-%B9%D8%D3%DA%D3%D1%D2%EA%D5%E4%B9%F3%B5%C4%B8%F1%D1%D4/23/

当page=0的时候伪静态成
/tag-%B9%D8%D3%DA%D3%D1%D2%EA%D5%E4%B9%F3%B5%C4%B8%F1%D1%D4/


回复讨论(解决方案)

RewriteCond %{QUERY_STRING} page=0&tagname=([^&]+)RewriteRule . http://bbs.hupu.com/tag-%1/? [R=302,L]RewriteCond %{QUERY_STRING} page=([\d]+)&tagname=([^&]+)RewriteRule . http://localhost/tag-%2/%1? [R=302,L]

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn