服务器无法读取htaccess文件,拒绝访问是安全的

编程入门 行业动态 更新时间:2024-10-05 09:30:51
本文介绍了服务器无法读取htaccess文件,拒绝访问是安全的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经使用AngularJS创建了一个简单的应用程序。当我尝试在我的网站 demo.gaurabdahal/recipefinder 中托管该项目时,它会显示以下错误:

I have created a simple app using AngularJS. When I tried to host that project in my website demo.gaurabdahal/recipefinder it shows the following error:

禁止使用

您没有访问此服务器上的/ recipefinder的权限。 服务器无法读取htaccess文件,拒绝访问是安全的

You don't have permission to access /recipefinder on this server. Server unable to read htaccess file, denying access to be safe

但是如果我转到 demo.gaurabdahal/ 它按预期显示了我已打印的访问被拒绝消息。但是,为什么无法打开AngularJS项目 recipefinder。如果我尝试在其中放置一个简单的HTML应用程序,它将打开就很好。

But if I go to demo.gaurabdahal/ it displays "access denied" message as expected, that I have printed. But why is it unable to open that AngularJS projects "recipefinder". If I tried to put a simple HTML app there, it opens just fine.

当我将其托管在github中时,同一个AngularJS项目也可以正常工作( gaurabdahal.github.io/recipefinder )

The same AngularJS project works fine when I host that in github (gaurabdahal.github.io/recipefinder)

我可以

推荐答案

我也遇到了这个问题。我的建议是查看服务器错误日志文件。对我来说,该项目的顶层目录不可读。错误日志清楚地表明了这一点。一个简单的

I had this problem too. My advice is look in your server error log file. For me, it was that the top directory for the project was not readable. The error log clearly stated this. A simple

sudo chmod -R 755 <site_top_folder>

为我修复了它。

更多推荐

服务器无法读取htaccess文件,拒绝访问是安全的

本文发布于:2023-11-02 06:49:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551665.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:服务器   文件   htaccess

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!