【发布时间】:2013-07-16 16:33:24
【问题描述】:
我正在尝试编写一个RewriteRule 来缩短Monitorix 网址,如下所示:
http://10.0.11.11:8089/monitorix-cgi/monitorix.cgi?mode=multihost.all&graph=all&when=1day&color=black
点赞:http://10.0.11.11:8089/mon/all
所以,我把它添加到了 /etc/apache2/apache2.conf(在 Debian wheezy 上)最后:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/?mon/all/?$ monitorix-cgi/monitorix.cgi?mode=multihost.all&graph=all&when=1day&color=black [NC,L]
</IfModule>
但它不起作用。我得到:The requested URL /mon/all was not found on this server. 我在这里找到了一些关于类似问题的帖子,但对我来说没有什么真正的工作。知道我在做什么错吗?是不是 URL 中的端口号造成了实际问题干杯!
更新为
RewriteLog(由@williamt 建议):
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 9
RewriteRule ^/mon/all/?$ http://10.0.11.11:8089/monitorix-cgi/monitorix.cgi?mode=multihost.all&graph=all&when=1day&color=black [NC,L]
</IfModule>
【问题讨论】:
标签: apache http mod-rewrite debian