OS X 10.6 Server .htaccess、WebDAV 和 CakePHP 问题
使用 CakePHP,我确实需要 .htaccess 文件工作,因此我启用了 mod_rewrite,并很快发现 OS X 的 Apache 配置阻止通过 WebDAV 上传和读取 htaccess 文件。我在 httpd.confg 中修复了这个问题,但遇到了麻烦。
Cake 的结构在三个主要位置都有这个 .htaccess 文件(还有其他位置,但这是现在最重要的) {, app, webroot}
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
一旦这些文件被复制到 OSX 服务器上的适当位置,WebDAV 就会停止工作。我无法再向目录写入或读取。我对 mod_rewrite 不太了解,但我猜如果请求是 WebDAV,我不需要应用重写规则。任何想法或修复都会非常有帮助。
With CakePHP I really need .htaccess files working so I enabled mod_rewrite and quickly found out OS X's Apache configuration blocks uploading and reading of htaccess files over WebDAV. I fixed that in httpd.confg but hit ran into a wall.
Cake's structure has this .htaccess file in three primary locations (there are others but this is what matters right now) {, app, webroot}
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
As soon as these files are copied into their place on the OSX server WebDAV stops working. I can no longer write to or read from the directories. I don't know much about mod_rewrite, but I'm guessing that I need to not apply rewrite rules if the requests are WebDAV. Any thoughts or fixes would be most helpful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也在解决这个问题,为了修复 3 次重写,我只需将我的虚拟主机指向 webroot 目录即可。
这是我放入 httpd.conf 中的代码,
我相信这是一个好的开始。
I am working on this problem too, to fix the 3times of rewrite, i will just point my virtual host to the webroot directory instead.
here is the code i put in my httpd.conf
This is a good start i believe it is.