我有位置匹配正则expression式
ScriptAlias /script /var/www/somescript.bash Action some-handler /script virtual <LocationMatch "/(?:\w+:)?\/\/[^\/]+([^?#]+)/"> SetHandler some-handler </LocationMatch>
现在,当testing该正则expression式https://regex101.com/r/lO0aV1/1你可以看到该位置匹配,但somescript.bash永远不会执行。
mod_actions就这样了。
在错误日志中,我什么都看不到。 在访问日志中,我得到了404。
我怎样才能检查这个正则expression式工作? 无论如何,我可以logging吗?
制作一个CustomLog,例如:
CustomLog "/var/log/httpd/mylog.log" "%h %l %u %t \"%r\" %>s %b what:%{INDICATOR_VAR}e"
并使用SetEnv来设置INDICATOR_VAR:
<LocationMatch ...> SetEnv INDICATOR_VAR "OK" </LocationMatch>
检查LocationMatch工作的最简单方法是在其中放入一个简单的mod_headers指令,并将响应头转储到testing客户机上。 例如Header set X-DEBUG foo