dtnat7146 2017-01-10 13:11
浏览 401

AH01797:客户拒绝... Yii app

I have a site developed in Yii2 on a VPS (Apache 2.4.23) structured like this:

user/app (all the sites files and directories)
user/public_html

In public_html there are links to directories and files such as:

.htaccess (file folder)
admin (file folder)
assets (file folder)
css (file folder)
images (file folder)
index (php file)

The psite has a frontend and backend, the backend is on a subdomain, and frontend on the domain (example.com and admin.example.com)

Frontend load fine both with http and https, whereas the backend does not load the assets (css and images), https on backend redirects to http which I don't want to.

On the error logs I see a bunch (too many to list them all) of errors, like the following samples:

[access_compat:error][pid][client]AH01797:client denied by server configuration: home/user/app/backend/web/index.php, referer http://admin.example.com/en/user/index

[access_compat:error][pid][client]AH01797:client denied by server configuration: home/user/app/backend/web/index.php

[access_compat:error][pid][client]AH01797:client denied by server configuration: home/user/app/backend/web/en

The htaccess files are the same for frontend and backend like this:

# use mod_rewrite for pretty URL support
RewriteEngine on
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php [L]
# use index.php as index file
DirectoryIndex index.php

I also tried (suggested by hosting support) with no success.

# use mod_rewrite for pretty URL support
RewriteEngine On
# enable symbolic links
Options +FollowSymLinks
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . index.php [L]
# use index.php as index file
DirectoryIndex index.php

Could you please tell me what's wrong and why frontend works fine, but the backend does not?

  • 写回答

1条回答 默认 最新

  • duanran6441 2017-01-11 11:30
    关注

    In a cpanel setup, subdomains can only be served from directories under public_html.

    评论

报告相同问题?

悬赏问题

  • ¥15 2024-五一综合模拟赛
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭