为什么我在具有 import 语句的 css 链接上的 localhost 上收到 403 错误?
为什么我在此链接上的 localhost 上收到 403 错误?
<script type="text/javascript" src="../js/cookies.js"> </script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/base/jquery-ui.css" type="text/css" media="all" />
THE FOLLOWING LINE CAUSES A 403 ERROR
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css" />
<link rel="stylesheet" href="../development-bundle/demos/demos.css" />
无奈之下,我将所有导致jquery.ui.all.css的权限更改为755,但这并没有解决问题。
这些是 jquery.ui.all.css 的内容:
@import "jquery.ui.base.css";
@import "jquery.ui.theme.css";
我添加的任何包含 import 语句的链接都会出现 403 错误。我花了几个小时寻找答案,但没有运气。有什么想法吗?谢谢。
Why am I getting a 403 error on localhost on this link?
<script type="text/javascript" src="../js/cookies.js"> </script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/base/jquery-ui.css" type="text/css" media="all" />
THE FOLLOWING LINE CAUSES A 403 ERROR
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css" />
<link rel="stylesheet" href="../development-bundle/demos/demos.css" />
In desperation, I changed the permissions of everything leading to jquery.ui.all.css to 755 which did not resolve the problem.
These are the contents of jquery.ui.all.css:
@import "jquery.ui.base.css";
@import "jquery.ui.theme.css";
Any link I add that has an import statement gives me a 403 error. I spent several hours searching for an answer but no luck. Any ideas? Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这很容易。这些目录之一没有权限(apache2)或者css文件没有权限用apache2
0755打开是正确的权限
It's pretty easy. One of these directories doen't have permissions (apache2) or that css file has no permission to be opened with apache2
0755 are correct permissions
我执行了以下步骤,
将每个文件的所有者和/或组更改为所有者和/或组。
OWNER 是您启动服务器的人。
当你执行 - chown --help 时,人们可以找到可能的用法。
接下来,更改文件的权限
注意
-R = 递归地将其应用于目录
403 错误中的所有文件夹/文件将得到解决。
正如 https://www.digitalocean 中所述.com/community/questions/proper-permissions-for-web-server-s-directory
I performed following steps
Change the owner and/or group of each FILE to OWNER and/or GROUP.
OWNER being the one with which you started the server.
When you do - chown --help, one can find the possible usages.
Next, Change permission of the file
Note
-R = recursively applies it to all folders/files within directory
403 error will be resolved.
As mentioned in https://www.digitalocean.com/community/questions/proper-permissions-for-web-server-s-directory