flutteriishrefradix

Flutter web base href subfolder


I am trying to deploy to IIS. Not in root but in a sub-folder. This is working:

Perfect!

BUT, when I try to debug using localhost: web pages does not found - error 404

What I want is to deploy (automatically), inside a sub-folder of wwwroot and execute local test too, without modifying index.html a lot of times

Is it possible to do something like in Angular, use proxies, use different build configs, etc?

Thanks


Solution

  • I've got a similar problem after upgrading flutter and dart to current version (beta channel), I mean it was good on debugging mode and It did not working on build release. What I did? I just commented this <base href="/"> line at index.html file (located inside the <your_app_folder_name>/web folder) and both (debugging and release builds) went back to working like charm.

    I did comment by changing the line

    <base href="/">
    

    to

    <!-- <base href="/"> -->
    

    Do the change and: try to run a flutter build web command, copy the generated web folder located at <your_app_folder_name>/build/ path to any subfolder (such as <your_websrv_root>/webtestfolder) of the your webserver, and it will work at the address http://webtestfolder of your browser.