2010-03-22 110 views
0

我有一個網站在其根目錄中有一些管理頁面。問題:訪問者是否有任何可能的方式查看此站點(或任何其他站點)根目錄中的所有頁面和/或子目錄?網絡目錄的內容

如果是,需要做些什麼來隱藏目錄的內容?

謝謝!

回答

2

您可以在Web服務器中設置此權限。對於IIS,可以在網站,虛擬目錄和應用程序上設置啓用目錄瀏覽屬性。

對於Apache:

在httpd.conf文件搜索選項,如果指數存在目錄瀏覽啓用否則被禁用 選項全部指標的FollowSymLinks多視圖 選項所有的FollowSymLinks多視圖(目錄瀏覽(目錄瀏覽啓用)已禁用)

0

這取決於您使用的服務器。例如,對於碼頭,您可以使用上下文文件(以xml格式)隱藏/隱藏目錄內容...

<?xml version="1.0"?> 
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> 

<Configure class="org.eclipse.jetty.server.handler.ContextHandler"> 
    <Call class="org.eclipse.jetty.util.log.Log" name="debug"> 
     <Arg>Configure sarbot_files.xml</Arg> 
    </Call> 
    <Set name="contextPath">/some_context</Set> 
    <Set name="resourceBase">/path/to/files</Set> 
    <Set name="handler"> 
     <New class="org.eclipse.jetty.server.handler.ResourceHandler"> 
     <!-- Set to true or false here --> 
      <Set name="directoriesListed">true</Set> 
      <Set name="welcomeFiles"> 
       <Array type="String"> 
        <Item>index.html</Item> 
       </Array> 
      </Set> 
      <Set name="cacheControl">max-age=3600,public</Set> 
     </New> 
    </Set> 
</Configure>