有个项目,tp5写的,要配置到项目的public目录下,一开始报错了...后面删除了配置,重新配置成功了,记录一下过程
1.首先,将网站根目录变为你的public目录下
2.添加解析程序的CGI,这里选择你需要解析程序的php版本
3.安装插件,这个安装后,可以让你的路由开启重写.(apache的重写模块是rewrite.so,这个模块的作用应该大致=IIS的路由重写模块)
https://www.iis.net/downloads/microsoft/web-platform-installer
4.重启iis
dos命令输入iisreset
5.附加提示:public目录下有一个web.config配置文件,这个是你变更项目目录自动就会创建的.
网上说要怎么怎么加,如果泥萌没有的化就加一个叭.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<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>
</system.webServer>
</configuration>