2016-09-08 1 views
1

저는 ASP.NET 웹 양식에 웹 포털을 구축했습니다. 나는 인터넷에서 검색 할 수 없도록하려는 내 페이지에 콘텐츠/블로그를 가지고 있습니다 (개인으로 만 로그인하면 볼 수 있습니다).asp.net 사이트 콘텐츠 비공개 (인터넷에서 검색 가능하지 않음)

아무에게도 어떻게 안내해야합니까?

+0

web.config 반면 나는 데이터베이스에서 콘텐츠를 요청시 페이지에 표시됩니다. 내 콘텐츠가 정적 콘텐츠가 아니라 동적 콘텐츠임을 의미합니다. – sam

답변

1

robots.txt 파일을 추가하면 검색 엔진에 특정 폴더 또는 내용을 무시하도록 지시 할 수 있습니다. 예 : robots.txt에

User-agent: * 
Disallow: /PrivateContent/ 
Disallow: /AdminStatistics.html 
이 예는 폴더 /PrivateContent 내의 내용을 무시하고 모든 검색 엔진을 알려줍니다

하고 AdminStatistics.html 페이지입니다.

물론 일반 사용자 (또는 robots.txt 파일을 고의로 검색하는 해커)는 차단되지 않습니다. 이를 위해서는 web.config 파일을 통한 액세스를 제한하는 것이 좋습니다.
예 :

<Configuration> 
    <!-- This section block unauthenticated user access to the AdminStatistics.aspx page only. 
     It is located in the same folder as this configuration file. --> 
    <location path="AdminStatistics.aspx"> 
     <system.web> 
      <authorization> 
       <deny users="?" /> 
      </authorization> 
     </system.web> 
    </location> 
    <!-- This section blocks unauthenticated user access to all of the files that are 
     stored in the PrivateContent folder. --> 
    <location path="PrivateContent"> 
     <system.web> 
     <authorization> 
      <deny users="?" /> 
     </authorization> 
     </system.web> 
    </location> 
</configuration> 

(https://support.microsoft.com/en-us/kb/316871에서 복사 한 코드)