Home > Backend Development > PHP Tutorial > PHP分类目录的伪静态该怎么实现

PHP分类目录的伪静态该怎么实现

WBOY
Release: 2016-06-13 12:16:15
Original
1094 people have browsed it

PHP分类目录的伪静态该如何实现
希望实现类似WordPress那样的,比如分类的连接地址为 http://www.xxx.com/catname/

因为URL中并没有出现分类id,而是分类名称,我该如何去读取该分类下的文章?伪静态规则又应该怎么去写
------解决思路----------------------
伪静态只有一条 /category/(.*) -> /category?catename=$1
原理跟id是一样的,只不过一个是用数字去查,一个是用字符串查

Related labels:
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