您的位置:首页 > 编程语言 > PHP开发

iis8 php 去除index.php配置web.config报500错误

2015-08-04 17:43 615 查看
编辑文件网站根目录web.config

<rewrite>
<rules>
<rule name="OrgPage" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^(.*)$" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" />
</rule>
</rules>
</rewrite>


打开url显示500错误

换成

<rewrite>
</rewrite>
也报错。

网上搜到原因是:需要安装url重写

即:urlrewrite2.exe

下载地址:http://www.microsoft.com/web/gallery/install.aspx?appid=urlrewrite2

也可到我的网盘寻找:soft/iis

下载安装后就正常了,打开IIS管理器,点击“Internet信息服务”->“网站”->“项目一”,看到图标“URL重写”,即表示安装成功了!!!!!

网上例子:

(1) webconfig 文件 system.webServer节点下配置rewrite 报错 是因为需要安装URL重写,微软下载链接:http://www.microsoft.com/zh-cn/download/details.aspx?id=7435

(2)注意在应用程序池中选择正确的托管管道模式。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: