![Apache httpd 重写模式不起作用](https://linux22.com/image/1419340/Apache%20httpd%20%E9%87%8D%E5%86%99%E6%A8%A1%E5%BC%8F%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
我正在使用这个 gitlab 配置https://github.com/gitlabhq/gitlab-recipes/blob/master/web-server/apache/gitlab.conf
以下是重写日志
125.121.60.59 - - [14/Aug/2014:12:50:23 +0800]
[xxx.xxx.com/sid#7f8e26a023c8][rid#7f8e26ca5be8/initial]
(4) RewriteCond: input='/home/git/gitlab/public/uploads/foo/bar/7b02f4c192/classes.png' pattern='!-f' => matched
我确信/home/git/gitlab/public/uploads/foo/bar/7b02f4c192/classes.png
存在。
为什么这个模式匹配?
答案1
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
-f
需要用户可读的文件运行httpd(apache
在centos上)。
您可以通过以下方式验证sudo -u apache stat /path/to/file