简体   繁体   English

HTML,CSS文件Apache权限

[英]Html, CSS files apache permissions

I have a question about file permissions of html - css files served by httpd (on CentOS). 我对html的文件权限有疑问-httpd提供的css文件(在CentOS上)。

I have a website with several html - php - css files. 我有一个带有多个html-php-css文件的网站。 When a user enters the URL of my website, index.html is displayed as it should. 当用户输入我的网站的URL时,将按原样显示index.html。 I tried to browse one of my css files (just for fun), and I realized that css source code is displayed in the browser. 我试图浏览我的一个css文件(只是为了好玩),我意识到css源代码显示在浏览器中。 I do not publish the css files and their exact names of course, but some names (eg style.css , bootstrap.css etc) are trivial, and one can try and get the styling of my webpage easily. 我当然不会发布css文件及其确切名称,但是有些名称(例如style.css,bootstrap.css等)是微不足道的,并且可以尝试轻松地获得我网页的样式。

What is the solution to that? 有什么解决方案? I cannot take off the read permissions of these files, because apache would not style the html files (since it will not be able to read the css). 我无法取消这些文件的读取权限,因为apache不会设置html文件的样式(因为它将无法读取css)。

There's no solution to that, css files must be readable and downloadable. 对此没有解决方案 ,css文件必须可读且可下载。 You can minify them if you want them to be less readable (and smaller which is its real use). 如果您希望它们的可读性较差(较小的是其实际用途),则可以缩小它们。

Edit: Relevant Answer 编辑:相关答案

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

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