CMS 软件中的空白 index.html 而不是 .htaccess [英] Blank index.html in CMS softwares instead of .htaccess

查看:15
本文介绍了CMS 软件中的空白 index.html 而不是 .htaccess的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到 Joomla、Wordpress 和其他 CMS 在其所有子文件夹中都有空白的 index.html 文件,以防止人们偷看文件夹结构.我的问题是为什么他们不能禁止使用 .htaccess 文件查看文件夹,而不是将一个空白的 index.html 文件放入所有文件夹.有什么区别?他们为什么选择 index.html?

I noticed Joomla, Wordpress and other CMSs have blank index.html files in ALL their sub folders to prevent people from peeking into the folder structure. My question is why can't they forbid folder viewing using the .htaccess file instead of putting a blank index.html file into all the folders. What's the difference and why have they chosen index.html?

推荐答案

最好在主 httpd.conf 或 vhosts.conf 文件而不是本地 .htaccess 文件中关闭文件夹索引".

Turning off folder 'Indexes' is best done in the master httpd.conf or vhosts.conf file rather than local .htaccess files.

Joomla(和之前的 Mambo)已经存在了很长一段时间,并广泛用于共享托管服务器.鉴于共享托管的混合"性质,决定使用 index.html 文件作为安全后备.显然 .htaccess 文件仅适用于 apache,如果出现在不期望它们的服务器上,或者它们包含某些服务器设置不支持的指令,则会导致服务器 500 错误.因此,默认情况下 Joomla 不附带 .htaccess 文件.有一个 htaccess.txt 文件,如果用户激活某些功能,则需要手动放置该文件.假设具有足够知识来放置文件的用户会了解后果,如果它确实杀死了他们的网站,他们将立即了解原因 - 由于他们的行为会立即发生错误.

Joomla (and Mambo before it) have been around quite a while and are used widely on shared hosting servers. The decision was taken to use index.html files as a safe fallback given the 'mixed' nature of shared hosting. Obviously .htaccess files are apache only, can cause server 500 errors if present on servers not expecting them or if they contain directives not supported by certain server setups. Consequently by default Joomla doesn't ship with a .htaccess file as such. There is a htaccess.txt file which the user needs to put in place manually if they activate certain features. It is assumed that a user knowledgeable enough to put the file in place will understand the consequences and if it does kill their site they will immediately understand the cause - due to the error immediately following their actions.

随着服务器设置的进步,关于当前使用 index.html 文件的有效性的讨论(有时很激烈) - 但目前的政策是所有附加组件都应在所有文件夹.

As server setups have advanced there is (sometimes heated) discussion about the current validity of the use of index.html files - but for now the policy is that all add-ons should ship with 'blank' index.html files in all folders.

这篇关于CMS 软件中的空白 index.html 而不是 .htaccess的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆