Home > Backend Development > PHP Tutorial > 非常变态的url重写,该如何解决

非常变态的url重写,该如何解决

WBOY
Release: 2016-06-13 10:24:31
Original
882 people have browsed it

非常变态的url重写
RewriteRule ^trade/(\d+)\.html$ /tradedetails.php?id=$1 [NC,L]

这两行规则在本地测试正常,放到空间上失效.但其他规则都正常.

最不能理解是这种现象:
RewriteRule ^trader/(\d+)\.html$ /tradedetails.php?id=$1 [NC,L]

我将trade 改成 trader 却正常.

其他规则中,也有trade关键字,为什么就它不行


求解

------解决方案--------------------
如果你的 URL 写的是 trader/1235.html
那么用 ^trade/(\d+)\.html$ /tradedetails.php?id=$1 [NC,L] 能匹配上吗
------解决方案--------------------

探讨
RewriteRule ^trade/(\d+)\.html$ /tradedetails.php?id=$1 [NC,L]

这两行规则在本地测试正常,放到空间上失效.但其他规则都正常.

最不能理解是这种现象:
RewriteRule ^trader/(\d+)\.html$ /tradedetails.php?id=$1 [NC,L]

我将trade 改成 trader 却正……
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