Home > Backend Development > PHP Tutorial > 正规则如何写

正规则如何写

WBOY
Release: 2016-06-23 13:16:27
Original
961 people have browsed it

RewriteRule ^_s([0-9]{1,})\.html$ s.php?id=$1

现在访问是这样_s1.html,是正常的。

如果我要在文件名里面加上标题怎么写规则,如abc-ded-abcd_s1.html     

abc ded abcd是标题,标题都是英文单词组成



回复讨论(解决方案)

RewriteRule ^([a-z\-]+*)_s([0-9]{1,})\.html$ s.php?title=$1&id=$2

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