由于Web.config文件,Robots.txt文件未显示

时间:2019-03-12 01:39:07

标签: php azure web-config robots.txt

我正在尝试通过直接链接(https://www.example.com/robots.txt)访问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文件。为什么没有显示任何想法。

谢谢

0 个答案:

没有答案
相关问题