在Apache的mod_rewrite逃逸点 [英] escaping dot in Apache mod_rewrite
问题描述
我一直在使用Apache的tuckey MOD-重写引擎重写URL。但是我对逃逸点装饰URLS问题,如下图所示,
I have been using tuckey Apache mod-rewrite engine to rewrite urls. But I have problems in escaping dots to decorate URLS as shown below,
www.example.com/hello.world -> www.example.com/derive.php
以下规则是我写上面做事情的人,
Following rules are the ones I have written to do the above thing,
RewriteRule ^/?(([A-Za-z0-9:-])+([.]*))$ /derive.php[L]
(重写规则^ /(([A-ZA-Z0-9: - \\])+)$ /derive.php[L]
是不允许的通过tuckey)
(RewriteRule ^/?(([A-Za-z0-9:-\.])+)$ /derive.php[L]
is not allowed by tuckey)
我认为这个问题可以通过完美的人谁使用tuckey装饰的URL来回答。
I think this question can be answered perfectly by people those who have used tuckey to decorate URLs.
推荐答案
在字符类,圆点没有任何特殊的意义,所以它不应该是必要躲开他们。你应该能够简单地写:
Inside a character class, dots don't have any special meaning, so it shouldn't be necessary to escape them; you should be able to write simply:
RewriteRule ^(?!/?derive[.]php$)/?[A-Za-z0-9:.-]+$ /derive.php [L]
这篇关于在Apache的mod_rewrite逃逸点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!