我已经使用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文件,拒绝访问是安全的
发布评论