[英]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.