对于Windows server服务器上使用IIS架设网站的网站长,可能都遇到过 访问首页会自动在网址后面加上index.php,那么我们如何使IIS服务器隐藏index.php,首页文件呢? 下面IT备忘录小编就给大家分享一个解决方法给大家,希望能帮到各位网站长。
方法步骤:
1、先下载安装微软的URL Rewrite模块
网址:https://HdhCmsTestiis.net/downloads/microsoft/url-rewrite#additionalDownloads
安装完成后iis会出现url重写模块
2、在项目网站根目录下创建web.config文件 写入以下代码即可
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="WPurls" enabled="true" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php/{R:0}" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
以上就是IT备忘录小编给各位网站长分享的IIS隐藏Index.php首页文件的方法,如果您觉得此方法好,请转载分享!
temp_banner("c01");查看更多关于IIS 服务器隐藏 index.php 的方法的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did195346