【问题标题】:Firebase Hosting - How to redirect domain to url (.pl to .com/pl)Firebase 托管 - 如何将域重定向到 url(.pl 到 .com/pl)
【发布时间】:2019-04-09 16:14:05
【问题描述】:

我正在使用 Firebase 托管。我拥有两个域: mydomain.commydomain.pl(波兰版)

我想将 mydomain.pl 重定向到 mydomain.com/pl(这是我管理网站翻译的方式)。

在 Firebase 托管配置中,我只能将 mydomain.pl 重定向到 mydomain.com。如果我输入 mydomain.com/pl,则会显示错误消息:“输入有效域(不是 URL)”。

网站使用 https 提供服务。

【问题讨论】:

  • 我想这就是你问题的答案stackoverflow.com/questions/5411538/redirect-from-an-html-page>
  • @AlexTrix 你指的是哪个答案?在提供的链接下,有很多使用 javascript 的黑客。我不确定这是解决我的问题的最佳方法。

标签: firebase-hosting


【解决方案1】:

不要使用 firebase 托管进行重定向,而是为 yourdomain.pl 创建一个 index.html 文件,然后使用 javascript 进行重定向。您根本不需要 index.html 文件中的任何内容,只需重定向即可。您可以使用此代码:

<script>
window.location = "https://yourdomain.com/pl";
<script>

如果您需要任何帮助,请告诉我。

【讨论】:

    猜你喜欢
    • 2016-03-16
    • 2017-04-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-17
    • 1970-01-01
    • 2013-06-13
    • 2020-10-14
    相关资源
    最近更新 更多