在虚拟主机环境中,希望使用处理程序。对于指定的目录,例如,images, script
要Apache
处理它。对于所有其他子目录,希望传递给处理程序。
一切正常,除了最后一个要求
注意:以下代码已更正并正在运行
<VirtualHost 127.0.1.12:80>
DocumentRoot /var/www
RewriteEngine On
ServerName monitor.phiddler.nit:80
UseCanonicalName Off
# for robots
RewriteCond %{HTTP_HOST} ^.
RewriteRule \.(php|php3|cgi|asp|aspx|jsp|cf|java|do|inc)$ /var/www [N,L]
# regular subdirs
RewriteCond %{HTTP_HOST} monitor.phiddler.nit
RewriteRule ^/(css|image|script|admin|ckeditor)/(.*) /data/phiddler/http/$1/$2 [L]
# ico file is in image
RewriteCond %{HTTP_HOST} monitor.phiddler.nit
RewriteRule \.ico$ /data/phiddler/http/image/$1.ico [L]
# name beginning with "." rerouted to ajax handler
RewriteCond %{HTTP_HOST} monitor.phiddler.nit
RewriteRule /\. /data/phiddler/http/ajax.php [L,QSA]
# all else goes to handler
RewriteCond %{HTTP_HOST} monitor.phiddler.nit
RewriteRule . /data/phiddler/http/handler.php [L]
</VirtualHost>
这应该很容易,但不知何故我想念它
另外,RewriteCond
每个之前都是必要的RewriteRule
吗?