win7系统都自带有iis的功能。关于WIN7下IIS的安装,请参考这里 http://jingyan.baidu.com/article/219f4bf723bcb2de442d38ed.html

首先要下载rewrite 的64位的组件 rewrite_x64_zh-CN.msi。官方的下地址是:http://www.microsoft.com/zh-cn/download/details.aspx?id=7435

选择简体中文版的就行。

WIN7 下IIS7的rewrite伪静态功能设置方法

 

安装之后,再配置web.config 增加 rewrite规则就可以实现伪静态的功能了。

  <system.webServer>
      <rewrite>
          <rules>
              <rule name="Test" patternSyntax="Wildcard">
                  <match url="WeChat/dist/*" />
                  <conditions>
                      <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                  </conditions>
                  <action type="Rewrite" url="/WeChat/dist/index.aspx" />
              </rule>
          </rules>
      </rewrite>
  </system.webServer>

用到这个方法主要是因为在部署ReactJs单页面应用项目到微信公众号时首页是index.aspx,公众号自定义菜单链接时访问的路由地址如:http://www.ex.com/WeChat/dist/member时会报错,所以才需要对IIS做以上的配置才能正常访问。

相关文章:

  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
  • 2022-02-14
  • 2021-12-10
  • 2021-09-08
  • 2021-05-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2022-12-23
  • 2022-02-26
相关资源
相似解决方案