• 解决IIS7多域名绑定同一物理目录,设置不同的默认文档的问题


    IIS7多域名绑定同一物理目录,设置不同的默认文档是没办法设置的,因为在一个物理目录下只有一个web.config,并且IIS7把默认文档设置写在这里,导致所有域名的默认文档设置共享。
    解决方法:
    1、进入%windir%system32inetsrvconfig目录(%windir%即windows的安装目录,比如c:windows) 
    2、找到applicationHost.config文件,用文本编辑器打开,如果打不开就复制出来修改后再替换原来的文件(建议备份原文件,以防不测,这是工作习惯。) 

    3、在最后configuration节中加入如下语句 

       <location path="A站点名称,例www.xxx.net">  
            <system.webServer>  
               <defaultDocument enabled="true">  
                  <files>       
                        <clear/>  
                        <add value="index.html"/>  
                  </files>  
               </defaultDocument>  
           </system.webServer>  
       </location>
     
       <location path="B站点名称,例wap.xxx.net">  
            <system.webServer>  
               <defaultDocument enabled="true">  
                  <files>       
                        <clear/>  
                        <add value="wapindex.html"/>  
                  </files>  
               </defaultDocument>  
           </system.webServer>  
       </location> 
    

      

    只加需要特别指定默认文档的站点,有几个加几个,无需重启IIS。 

    如以上方式不成功的话,在两个站点的默认文档里,先恢复默认文档为“恢复为继承的项”,然后再去设置applicationHost.config就可以了

    来源:https://blog.csdn.net/chaoyang0502/article/details/77247316

  • 相关阅读:
    python中的unlink
    if
    python中if __name__ == '__main__'
    rename函数
    win2003的密钥
    url
    python中的os.stat
    python中的mysql
    防火墙
    网址
  • 原文地址:https://www.cnblogs.com/guanshan/p/guan2018-09-18-001.html
Copyright © 2020-2023  润新知