我有规则(如下),我们添加了一个新的别名 /msn,它有一些静态内容,比如一个 html 文件ayuda.html
,它是目录索引文件和一些图像。
目前我可以看到 HTML 文件,但看不到图像。也有不同的错误取决于我去domain.com/msn
或domain.com/msn/
。在第一种情况下,图像位置没有被重写为domain.com/msn/image-blah-blah.jpg
,但在第二种情况下确实如此。
这是虚拟目录:
<VirtualHost *:80>
ServerAdmin administracion.linux@yellargentina.com
DocumentRoot "/opt/tomcat-5.5.30/webapps/portalPA"
ServerAlias *.amarillas.tm.yellargentina.com
CustomLog /tmp/amarillas-access_log combined
ErrorLog /tmp/amarillas-error_log
RewriteLog /tmp/amarillas-rewrite_log
RewriteLogLevel 9
JkUnMount /images/*.gif w1
JkUnMount /images/*.png w1
JkUnMount /images/*.jpg w1
JkUnMount /js/*.js w1
JkUnMount /styles/*.css w1
#JkMount /jkmanager/* jkstatus
JkMount /portalPA w1
JkMount /portalPA/* w1
JkUnMount /msn/* w1
CookieName PaginasAmarillas
CookieExpires "2 years"
CookieDomain ".tm.yellargentina.com"
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
Options +FollowSymlinks
RewriteRule ^/(msn|msn/) /msn/ayuda.html [PT]
RewriteRule ^/msn/ayuda.html$ /msn/ [R,L]
RewriteRule ^/msn/(?!ayuda.html)(.*) /msn/$1 [R,L]
RewriteRule ^/$ /portalPA/index.action [PT]
RewriteRule ^/portalPA/index.action / [R]
RewriteRule ^/(?!portalPA/)(.*) /portalPA/$1 [PT]
</VirtualHost>
当我尝试访问时的日志domain.com/msn/
10.248.19.52 - - [23/Aug/2011:16:54:36 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc8338/initial] (2) init rewrite engine with requested uri /msn/yello-apps-mesenger.jpg
10.248.19.52 - - [23/Aug/2011:16:54:36 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc8338/initial] (3) applying pattern '.*' to uri '/msn/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:54:36 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc8338/initial] (4) RewriteCond: input='GET' pattern='^(TRACE|TRACK)' => not-matched
10.248.19.52 - - [23/Aug/2011:16:54:36 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc8338/initial] (3) applying pattern '^/(msn|msn/)' to uri '/msn/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:54:36 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc8338/initial] (2) rewrite '/msn/yello-apps-mesenger.jpg' -> '/msn/ayuda.html'
10.248.19.52 - - [23/Aug/2011:16:54:36 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc8338/initial] (2) forcing '/msn/ayuda.html' to get passed through to next API URI-to-filename handler
当我尝试访问时的日志domain.com/msn
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc02f8/initial] (2) init rewrite engine with requested uri /msn
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc02f8/initial] (3) applying pattern '.*' to uri '/msn'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc02f8/initial] (4) RewriteCond: input='GET' pattern='^(TRACE|TRACK)' => not-matched
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc02f8/initial] (3) applying pattern '^/(msn|msn/)' to uri '/msn'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc02f8/initial] (2) rewrite '/msn' -> '/msn/ayuda.html'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc02f8/initial] (2) forcing '/msn/ayuda.html' to get passed through to next API URI-to-filename handler
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (2) init rewrite engine with requested uri /yello-apps-mesenger.jpg
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (3) applying pattern '.*' to uri '/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (4) RewriteCond: input='GET' pattern='^(TRACE|TRACK)' => not-matched
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (3) applying pattern '^/(msn|msn/)' to uri '/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (3) applying pattern '^/msn/ayuda.html$' to uri '/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (3) applying pattern '^/msn/(?!ayuda.html)(.*)' to uri '/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (3) applying pattern '^/$' to uri '/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (3) applying pattern '^/portalPA/index.action' to uri '/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (3) applying pattern '^/(?!portalPA/)(.*)' to uri '/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (2) rewrite '/yello-apps-mesenger.jpg' -> '/portalPA/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (2) forcing '/portalPA/yello-apps-mesenger.jpg' to get passed through to next API URI-to-filename handler