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

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

WBOY
Release: 2016-06-23 14:20:49
Original
958 people have browsed it

/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]
Copy after login

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template