简体   繁体   English

服务器无法读取 htaccess 文件

[英]Server unable to read htaccess file

Hosted a new website.主持一个新的网站。 But when ever I open my website in the browser it is throwing the below error.但是当我在浏览器中打开我的网站时,它会抛出以下错误。 Tried changing the .htaccess ReWriteRule but could not resolve it.尝试更改.htaccess ReWriteRule但无法解决。

You don't have permission to access / on this server.您无权访问此服务器上的 /。 Server unable to read htaccess file, denying access to be safe Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.服务器无法读取 htaccess 文件,为了安全而拒绝访问 此外,在尝试使用 ErrorDocument 处理请求时遇到 403 Forbidden 错误。

This most likely means that apache doesn't have permission to read the directory where your .htaccess is located.这很可能意味着apache没有权限读取您的.htaccess所在的目录。 Check the permissions on the folder where the file is located.检查文件所在文件夹的权限。

Ok, so I was facing this issue as well.好的,所以我也面临这个问题。 Now keep in mind, the location of my application was a folder being shared with the Guest OS.请记住,我的应用程序的位置是一个与来宾操作系统共享的文件夹。 Now what I had forgotten to do is to check, and make sure all permissions were enabled on said file on the HostOS.现在我忘记做的是检查并确保在 HostOS 上的所述文件上启用了所有权限。

So what I recommend is that you check the file permissions on the HostOS.所以我建议您检查 HostOS 上的文件权限。 Might be nothing you did, just something you forgot to do.可能你什么都没做,只是你忘了做某事。 Here is a screen shot of what I'm talking about.这是我正在谈论的内容的屏幕截图。

Correct file permissions on left, zend skeleton displaying on right左侧修正文件权限,右侧显示 zend 框架

I was unable to restart apache using my ID.我无法使用我的 ID 重新启动 apache。 So I restarted it using root user and hence this error.所以我使用root用户重新启动它,因此出现了这个错误。 Later I changed access permission of httpd folder to 755 and restarted using my ID.后来我把httpd文件夹的访问权限改为755,用我的ID重启。 The issue was resolved.问题已解决。

hello I think you have some problem with permission like it's was mentioned on your hosting you will find some number near your file like 755 those are the privilege of your file if there wasn't on that number 7 maybe 5 or 4 change it to 7 and like that your application could get the access and lunch your application你好,我认为你的权限有一些问题,就像你的主机上提到的那样,你会在你的文件附近找到一些数字,比如 755 如果那个数字 7 上没有,那么这些是你的文件的特权,也许 5 或 4 将其更改为 7这样您的应用程序就可以获得访问权限并为您的应用程序提供午餐

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM