Enable directory/file listing in XAMPP

﹥>﹥吖頭↗ 提交于 2020-01-11 10:26:53

问题


How to enable directory and file listing in XAMPP ? In WAMP it is by default enabled.


回答1:


My Xampp httpd.conf already had the Indexes option under the xampp directory entry Removing all the default #comment lines, it looks like this:

<Directory "C:/xampp/htdocs">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

But, I have my local root mapped to a different directory, outside of 'htdocs', (as per this post Make XAMPP/Apache serve file outside of htdocs ) so to enable this for all directories, I had to find the entry just above that, and add the word "Indexes" to it.

<Directory />
    Options FollowSymLinks Indexes
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

Note I would never enable this for all directories on a production server, but locally it is quite useful.




回答2:


Just delete or rename index.html and index.php files




回答3:


There is a XAMPP Directory Browsing UI app, that will help you to browse projects inside htdocs in XAMPP.




回答4:


Open apache/conf/httpd.conf and search for Indexes, to disable directory listing this value should be -Indexes so you should remove the - character. In my httpd.conf I have this value set like this:

Options Indexes FollowSymLinks Includes ExecCGI



回答5:


Open apache/conf/httpd.conf and search for Indexes in httpd.conf And comment complete line like this:

#Options Indexes FollowSymLinks Includes ExecCGI
#Options  - Indexes FollowSymLinks Includes ExecCGI

Uncommenting First will enable the indexing of directories. Uncommenting Second will disable indexing of directories Removing the comment will enable the Directory/file listing of hosted path.




回答6:


Rename the 'index.php' file that sits in your htdocs folder to something like 'MODIFIED_index.php' (if you want to be able to revert to it later) - this index.php file is only used to point to xampp's admin controls that are found in 'localhost/xampp/' anyway.



来源:https://stackoverflow.com/questions/8870560/enable-directory-file-listing-in-xampp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!