ModRewrite 语法
我想知道是否有人可以解释语法,或者找到关于 mod_rewrite 模块使用的语法的好教程?
我查看了各种示例,认为我知道发生了什么,但现在我想编写自己的规则,我需要 100%
我感觉到 apache 文档,同时向您展示了哪里代码写得很好,对解释逻辑没有任何帮助。
提前致谢 :)
I was wondering if anyone could explain the syntax, or has found a good tutorial on the syntax used by the mod_rewrite module?
I have looked at various examples and think I know what's going on, but now that i'm wanting to write my own rules I need to be 100%
I feel the apache documentation while shows you where to the put the code quite well, does nothing for explaining the logic.
Thanks in advance :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ModRewrite 用于描述 URL 及其重写的语法使用正则表达式。熟悉这个概念后,其余的就很容易理解了。
一般来说,重写规则的形式如下:
其中
from
是与源 URI 匹配的正则表达式,to
是具有可选替换的目标(这些也在给定的参考文献中进行了描述)多于)。The syntax used by ModRewrite to describe URLs and their rewrites use regular expressions. Familiarise yourself with this concept and the rest should follow quite easily.
In general, a rewrite rule has the form
Where
from
is a regular expression matching the source URI andto
is the target with optional replacements (these are also described in the reference given above).