转移到专用虚拟服务器,在 .htaccess 和权限方面遇到问题
使用 cakePHP
我的 index.php 位于 www.domain.com/httpdocs/sub/app/webroot
以前,在共享主机上,我只是将“domain.com/”替换为“domain.com/app+core 目录”(没有 httpdocs / 或 sub/)
我已转移到媒体寺庙专用虚拟服务器并遇到 403 禁止错误: “您无权访问此服务器上的/sub/。”
sub/目录的权限设置为755
在domain.com/sub/app -> .htaccess 文件:
代码:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /sub/app/
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
在domain.com/sub/app/webroot -> .htaccess 文件:
代码:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteBase /sub/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
我已经尝试过: 现在 httpdocs/ 包含空白的 index.html 和简单的重定向:
Redirect /index.html http://domain.com/sub/
为 /sub 创建另一个 .htaccess 文件,但这似乎让事情变得更加混乱。
我在媒体寺庙上,遵循这篇文章: http://wiki.mediatemple.net/w/403_Forbidden_error< /a>
谢谢
Working with cakePHP
My index.php is in www.domain.com/httpdocs/sub/app/webroot
Previously, on shared hosting I just replaced "domain.com/" with "domain.com/app+core directories" (without httpdocs/ or sub/)
I've moved to media temple dedicated virtual server and am hitting a 403 forbidden error:
"You don't have permission to access /sub/ on this server."
Permission is set to 755 for sub/ directory
In domain.com/sub/app -> .htaccess file:
Code:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /sub/app/
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
In domain.com/sub/app/webroot -> .htaccess file:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteBase /sub/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
I've tried:
Right now httpdocs/ contains blank index.html and simple redirect:
Redirect /index.html http://domain.com/sub/
Creating another .htaccess file for /sub, but that seemed to confound things further.
I'm on media temple, followed this article: http://wiki.mediatemple.net/w/403_Forbidden_error
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
注意到您的 (dv) 存在一些问题。我们只是想让您知道,我们随时帮助您解决可能遇到的任何问题。如果您不断遇到这些错误,请提出支持请求,以便我们帮助您解决问题。
Noticed you were having some issues with your (dv). We just wanted to let you know that we are here to help you with any problems that you may have. If you keep running into these errors, please open up a Support Request so we can help you out.