0
在虛擬主機環境中,希望使用處理程序。對於指定的目錄,例如images, script
,需要Apache
來處理它。對於所有其他子目錄,希望傳遞給處理程序。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>
這應該是很容易的,但不知何故,我很想念它
也,是每個RewriteRule
之前必需的RewriteCond
?