admin管理员组文章数量:1023018
Ok I created my first web application with Flutter, setup SSL and have a domain with two flavours.
and
setup on IIS.
How can I redirect http
to https
with Flutter?
I could create Url rewrite server side but I would love to do via Flutter.
Is there such a configuration available?
Ok I created my first web application with Flutter, setup SSL and have a domain with two flavours.
http://example and
https://example setup on IIS.
How can I redirect http
to https
with Flutter?
I could create Url rewrite server side but I would love to do via Flutter.
Is there such a configuration available?
Share Improve this question asked Nov 18, 2024 at 20:47 CodeNewbieCodeNewbie 191 silver badge5 bronze badges 1- Do you think that only formatting the url string could be work? Like if you receive hhtp format it to https and if not exist return an error. – Alexandre B. Commented Nov 19, 2024 at 0:41
2 Answers
Reset to default 1The SSL redirection should be setup on your DNS and Hosting service rather than in Flutter web implementation or any Web implementation for that matter. Please check with your DNS provider and Hosting provider on SSL certificate installation and enabling SSL redirection.
Since the server is IIS I a added the following web.config
to handle the https
redirection by using the Rewrite Module
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTPS force" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Ok I created my first web application with Flutter, setup SSL and have a domain with two flavours.
and
setup on IIS.
How can I redirect http
to https
with Flutter?
I could create Url rewrite server side but I would love to do via Flutter.
Is there such a configuration available?
Ok I created my first web application with Flutter, setup SSL and have a domain with two flavours.
http://example and
https://example setup on IIS.
How can I redirect http
to https
with Flutter?
I could create Url rewrite server side but I would love to do via Flutter.
Is there such a configuration available?
Share Improve this question asked Nov 18, 2024 at 20:47 CodeNewbieCodeNewbie 191 silver badge5 bronze badges 1- Do you think that only formatting the url string could be work? Like if you receive hhtp format it to https and if not exist return an error. – Alexandre B. Commented Nov 19, 2024 at 0:41
2 Answers
Reset to default 1The SSL redirection should be setup on your DNS and Hosting service rather than in Flutter web implementation or any Web implementation for that matter. Please check with your DNS provider and Hosting provider on SSL certificate installation and enabling SSL redirection.
Since the server is IIS I a added the following web.config
to handle the https
redirection by using the Rewrite Module
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTPS force" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
本文标签: sslHow can I redirect a Flutter web application to httpsStack Overflow
版权声明:本文标题:ssl - How can I redirect a Flutter web application to https? - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745595206a2158125.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论