홈>
직접 링크 ( https : // www를 사용하여 robots.txt 파일에 액세스하려고합니다. .example.com/robots.txt ) 그러나 404 오류가 계속 발생합니다. 내 web.config 파일과 관련이 있다고 생각하지만 확실하지는 않습니다.
여기서는 web.config 파일입니다
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<!-- BEGIN rule TAG FOR HTTPS REDIRECT -->
<rule name="Force HTTPS" enabled="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
<!-- END rule TAG FOR HTTPS REDIRECT -->
<rule name="Rewrite to index.php">
<match url="index.php|images|test.php" />
<action type="None" />
</rule>
<rule name="Rewrite CI Index">
<match url=".*" />
<conditions>
<add input="{REQUEST_FILENAME}" pattern="css|js|jpg|jpeg|png|gif|ico|htm|html" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
내 robots.txt 파일은 간단합니다
사용자 에이전트 : * 허용하지 않음 : 사이트 맵 : https://www.example.com/sitemap.xml
웹앱의 루트 디렉토리에 robots.txt 파일을 추가했습니다. 표시되지 않는 이유에 대한 아이디어가 있습니다.
감사합니다
- 답변 # 1
트렌드
- OpenCv의 폴더에서 여러 이미지 읽기 (python)
- 파이썬 셀레늄 모든 "href"속성 가져 오기
- html - 자바 스크립트 - 클릭 후 변경 버튼 텍스트 변경
- git commit - 자식 - 로컬 커밋 된 파일에 대한 변경을 취소하는 방법
- JSP에 대한 클래스를 컴파일 할 수 없습니다
- javascript - 현재 URL에서 특정 div 만 새로 고침/새로 고침
- jquery - JavaScript로 현재 세션 값을 얻으시겠습니까?
- javascript - swiperjs에서 정지, 재생 버튼 추가
- JavaScript 변수를 HTML div에 '출력'하는 방법
- python - 문자열에서 특정 문자 제거
문제를 재현하려고했지만 결과가
<올>404
를 얻는 것과 다르지 않다 상태 코드. 아래 단계는 다음과 같습니다.새 웹 애플리케이션을 작성했으며 일부 파일에는
robots.txt
가 포함되었습니다.index.php
(코드 하나만phpinfo();
) 및web.config
당신과 같은 내용으로. 그런 다음https://<my webapp name>.azurewebsites.net/robots.txt
에 액세스했습니다.200
를 얻기 위해phpinfo()
의 답변 아래 그림과 같이.와이즈 비츠를 본다 url은
robots.txt
로 리디렉션하기 위해 아래 세 번째 규칙에 의해 다시 작성되었습니다. .그래서
<rule name="Rewrite CI Index"> <match url=".*" /> <conditions> <add input="{REQUEST_FILENAME}" pattern="css|js|jpg|jpeg|png|gif|ico|htm|html" negate="true" /> </conditions> <action type="Rewrite" url="index.php/{R:0}" /> </rule>
를 추가하기 위해 위의 규칙을 변경했습니다.txt
에 아래처럼 꼬리를 본 다음pattern
를 검토합니다. 작동하는 url.도움이 되길 바랍니다.
<add input="{REQUEST_FILENAME}" pattern="css|js|jpg|jpeg|png|gif|ico|htm|html|txt" negate="true" />