转移到专用虚拟服务器,在 .htaccess 和权限方面遇到问题

发布于 2024-10-03 11:47:58 字数 1284 浏览 0 评论 0原文

使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅唱ヾ落雨殇 2024-10-10 11:47:59

注意到您的 (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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文