简体   繁体   English

我创建了一个子域,当我尝试访问它时,它给出了拒绝访问错误

[英]I created a subdomain and when I try to reach it , it gives access denied error

I've created a subdomain.我创建了一个子域。 (track.example.com) (track.example.com)

I use direct Admin panel so I set the roots for我使用直接管理面板,所以我设置了根

public: /domains/track.example.com/public_html公共: /domains/track.example.com/public_html

private: /domains/track.example.com/private_html私人: /domains/track.example.com/private_html

I copied my files to both folders above.我将文件复制到上面的两个文件夹中。 Now when I try to load track.example.com , It throws 403 error.现在,当我尝试加载track.example.com时,它会引发 403 错误。 what is the problem?问题是什么?

( Update: when I try to load the address with HTTPS. it works fine ! ) (更新:当我尝试使用 HTTPS 加载地址时。它工作正常!)

( Update 2: When I try to request index.php directly, The site loads fine ! ) (更新 2:当我尝试直接请求 index.php 时,网站加载正常!)

My log: 2021-12-09 09:45:56.848516 [INFO] [16025] [151.246.223.141:23540#APVH_www.track.example.com] Auto Index is disabled for [/home/h170081/domains/example.com/public_html/track/], access denied我的日志: 2021-12-09 09:45:56.848516 [INFO] [16025] [151.246.223.141:23540#APVH_www.track.example.com] Auto Index is disabled for [/home/h170081/domains/example.com/public_html/track/], access denied

htaccess content: htaccess 内容:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !=localhost
RewriteCond %{HTTP_HOST} !=127.0.0.1
RewriteCond %{REMOTE_ADDR} !=127.0.0.1
RewriteCond %{REMOTE_ADDR} !=::1

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L,QSA]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s(.*)/index\.php [NC]
RewriteRule ^ $1 [R=302,L]

ErrorDocument 404 /notfound.php

I've faced same problem before.我以前也遇到过同样的问题。 You will need to move all of your track.example.com content to this path: /domain/example.com/public_html/track您需要将所有track.example.com内容移动到此路径: /domain/example.com/public_html/track

Also you need to remove the existing settings for subdomain and set it to default.您还需要删除子域的现有设置并将其设置为默认值。

The reason for this is that your service provider set the allowed path to the path I mentioned.原因是您的服务提供商将允许的路径设置为我提到的路径。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 虽然我正确创建了路线但是当我尝试显示页面时它给了我一个找不到错误页面 - Although I created the route correctly But when I try to show the page It gives me an error page not found 尝试登录时出现“无法访问 API”错误 - Error "Couldn't reach API" when I try to log in 当我尝试编辑或删除时,它会给出“试图访问非对象错误的属性”。 php - when i try to edit or delete it gives "trying to access property of a non object error". laravel php 当我尝试创建表时,SQL或mariadb给我此错误 - SQL or mariadb gives me this error when I try to create a table OAuth2 令牌,消息:'{“error”:“access_denied”}' 在我尝试使用 OAuth(服务帐户)更新 Google 日历时返回 - OAuth2 token, message: '{ “error” : “access_denied” }' returned when I try to update Google Calendar using OAuth (Service Account) 当我尝试远程访问mysql时,拒绝用户'root'@'localhost'的访问(使用密码:是) - Access denied for user 'root'@'localhost' (using password: YES) when i try accessing mysql remotely 当我尝试从 android 应用程序中的 php 脚本恢复数据时,访问被拒绝 403 - Access denied 403 when I try to recover data from php script in android app 当我尝试在php中的数据库中插入空图像时为什么会出错? - Why gives error when I try insert an empty image in database in php? 当我尝试安装作曲家要求riazxrazor / payumoney时,出现错误 - when i try to install composer require riazxrazor/payumoney it gives me an error 当我尝试通过终端“ php artisan serve”命令时,它会在Ubuntu中给出致命错误 - When i try to command through terminal 'php artisan serve' it gives Fatal error in ubuntu
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM