在CMS软件中输入空索引,而不是.htaccess [英] Blank index.html in CMS softwares instead of .htaccess

查看:100
本文介绍了在CMS软件中输入空索引,而不是.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?

推荐答案

关闭文件夹Indexes .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文件的当前有效性的讨论(有时热门) - 但现在的政策是所有的附件都应该随空白索引一起提供。所有文件夹中的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软件中输入空索引,而不是.htaccess的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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