php - Codeigniter 应用程序 Apache 到 IIS
问题描述
我有一个在 Linux 环境中运行的 codeigniter 应用程序,并希望将其迁移到 Windows 环境。
我通过 FTP 迁移了文件。主页可以正常使用图像和样式,但链接不能正常工作并显示错误 404。
它与htaccess和web.config有关吗?
解决方案
通过为 web.config 重写 htaccess 并更改 base_url 来解决。
<system.webServer>
<rewrite>
<rules>
<rule name="Main Rule" 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>
推荐阅读
- arduino - 在 Arduino Mega 上使用蓝牙触发继电器时出现问题
- flutter - 如何使用 GestureDetector 在卡片上添加飞溅效果
- c# - 当我们应该为视图创建单独的目录时
- ios - iOS - SiriKit 意图扩展 - 看不到打印也看不到断点
- sql - 如何使用 EF6 保存时间值
- internationalization - 在 Hugo 网站上重定向缺失的翻译
- sql - 使用大于和小于比较搜索的 CASE 语句
- python - 如何在Python中提取href内容?
- visual-studio-code - Python Keyerror 'sapi5',无法理解错误
- ios - Expected to decode Dictionary
but found a number instead.", underlyingError: nil))