我用.htaccess文件保护.env文件,脚本如下:
<Files .env>
Order allow,deny
Deny from all
</Files>如果我使用url访问此文件
https://myapp.mydomain.com/.env我得到这个页面错误:禁止
You don't have permission to access /.env on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.如何自定义此页面错误?
我尝试像这样覆盖App\Exceptions\Handler.php:
public function render($request, Exception $exception)
{
if($e instanceof HttpException && $e->getStatusCode() == 403){
return abort(403,'Access Denied');
}
return parent::render($request, $exception);
}但是没有结果
https://stackoverflow.com/questions/47710485
复制相似问题