laravel - Laravel 6.0 IIS 添加虚拟目录 HTTP 错误 404.0 - 未找到
问题描述
我在 Windows 10 主机中使用 IIS 运行 Laravel 项目并且在主页上它工作但我单击登录或注册它不起作用?
如果 localhost/tms 它工作但 localhost/tms/login HTTP 错误 404
解决方案
感谢您提供答案这是我的答案
在公共目录中添加文件 web.config 并粘贴规则:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Rule 1" stopProcessing="true">
<match url="^(.*)/$" ignoreCase="false" />
<action type="Redirect" redirectType="Permanent" url="/{R:1}" />
</rule>
<rule name="Rule 2" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
推荐阅读
- javascript - jQuery背景图像幻灯片未在浏览器引导程序4中显示图像
- node.js - 当它是请求标头[javascript nodeJS]的一部分时如何获取api密钥?
- python - Selenium 按标签名称搜索选项
- windbg - 忽略 Windbg 条件断点中的某些位置
- cmake - CMake:如何正确分发不会安装的基于 CMake 的库
- c# - 静态 HttpClient 仍在创建 TIME_WAIT tcp 端口
- php - 调试 - 在没有代码的行上设置断点
- dockerfile - Dockerfile PHP、NGINX 和 Composer
- java - 如何延迟加载spring bean?
- python - 优化列表中元素之间的计数变化