Home > Backend Development > PHP Tutorial > htaccess中文伪静态的问题。

htaccess中文伪静态的问题。

WBOY
Release: 2016-06-23 14:27:22
Original
891 people have browsed it

htaccess

现在的情况:

/tag.php?tags=标签&page=2

写成htaccess伪静态该怎么写?


这个是我写的,后面的page就写不来了。

RewriteRule ^tags/([^/]+)$ tag.php?tag=$1

回复讨论(解决方案)

若没有另外安装插件,则 apache 是不支持宽字符路径的

RewriteRule ^tags/([^x00-xff\dA-Za-z]+?)(/\d+)?$ tag.php?tag=$1&page=$2
Copy after login
Copy after login
Copy after login

现在的情况:

/tag.php?tags=标签&page=2

写成htaccess伪静态该怎么写?


这个是我写的,后面的page就写不来了。

RewriteRule ^tags/([^/]+)$ tag.php?tag=$1
根据编码改上面的正则,我那个是针对utf-8的中文写的

RewriteRule ^tags/([^x00-xff\dA-Za-z]+?)(/\d+)?$ tag.php?tag=$1&page=$2
Copy after login
Copy after login
Copy after login


格式是这样的 /tags/标签/page1


RewriteRule ^tags/([^x00-xff\dA-Za-z]+?)(/\d+)?$ tag.php?tag=$1&page=$2
Copy after login
Copy after login
Copy after login


格式是这样的  /tags/标签/page1


无语,那你再我的基础上加上page不就完了么?还得照搬你才会写么?

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