How to prevent a file from direct URL Access?

后端 未结 7 2018
后悔当初
后悔当初 2020-11-22 05:26

I\'m using Apache and I have a sample web folder on my Local Host, like:

      http://localhost/test/

Files in th

7条回答
  •  囚心锁ツ
    2020-11-22 06:11

    First of all, find where the main apache’s config file httpd.conf is located. If you use Debian, it should be here: /etc/apache/httpd.conf. Using some file editor like Vim or Nano open this file and find the line that looks as follows:

    Options Includes Indexes FollowSymLinks MultiViews
    

    then remove word Indexes and save the file. The line should look like this one:

    Options Includes FollowSymLinks MultiViews
    

    After it is done, restart apache (e.g. /etc/init.d/apache restart in Debian). That’s it!

提交回复
热议问题