yangli-1128

VUE IIS 404

1.安装url-rewrite

下载地址 https://www.iis.net/downloads/microsoft/url-rewrite

可能 提示下载安装 【web平台安装程序】

可能提示失败,查看错误日志,手动下载相应的安装问题,我这是需要下载 rewrite_amd64_zh-CN.msi

https://download.microsoft.com/download/1/2/8/128E2E22-C1B9-44A4-BE2A-5859ED1D4592/rewrite_amd64_zh-CN.msi

2.重新打开IIS,

如果没有 URL重写,请重启服务器

3.配置

由于我在目录下配置了API,网上找的方法都配置失败。最终采用404和500的重定向解决。原始网页忘记了,没有记录。

----------------------------------------------------------------------------

解决配置如下:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.web>
        <customErrors mode="On" defaultRedirect="index.html">
            <error statusCode="404" redirect="index.html" />
        </customErrors>
    </system.web>
    <system.webServer>
        <httpErrors errorMode="Custom">
            <remove statusCode="404" />    
            <remove statusCode="500" />          
            <error statusCode="500" path="/index.html" responseMode="ExecuteURL" />
            <error statusCode="404" path="/index.html" responseMode="ExecuteURL" />
        </httpErrors>
      
    </system.webServer>
</configuration>


标签: IIS VUE
上一篇 下一篇
评论
©yangli-1128 | Powered by LOFTER