301使用Webpack dev服务器重定向

时间:2018-03-01 17:02:32

标签: webpack webpack-dev-server http-status-code-301

我正在尝试从这种格式重定向网址:

http://localhost:8080/setup/xyz/?code=some-code

到此:

http://localhost:8080/app/#/setup/xyz/?code=some-code

我尝试了代理和重写:

historyApiFallback: {
  rewrites: [
    { from: /^\/$/, to: '/index.html' },
    { from: /^\/app/, to: '/app.html' },
    { from: /^\/setup/, to: '/app/#/setup' },
  ]

},

但它似乎不起作用。有没有办法使用开发服务器编写301重定向?

0 个答案:

没有答案