大网数据广告活动
网站运营与故障问答

Firebase redirects http to https with 307 code (Temporarily Moved), which is bad as per SEO. How to configure it to use 301 code (Permanently Moved)

· 52CE 我爱测

My website is hosted with Firebase. It offers https out of the box. When a user hits http://example.com , it redirects to https://example.com with 307 code (Temporarily Moved). As per various SEO guidelines, this is not good prac…

问题原文

原帖链接 · Kaushal B · CC BY-SA 4.0

My website is hosted with Firebase. It offers https out of the box. When a user hits http://example.com, it redirects to https://example.com with 307 code (Temporarily Moved). As per various SEO guidelines, this is not good practice. How to configure firebase to use 301 (Permanently Moved)?

已采纳解答

原帖链接 · Maximillian Laumeister · CC BY-SA 4.0

I just tested this out on a Firebase Hosting site and (after disabling my browser extensions) I got a 301 redirect, not a 307.

What are you using to inspect the status code? Web browsers sometimes report a 307 status code when there's an internal redirect within the browser itself before it sends the request.

Chrome for example calls this kind of pre-request redirect a 307 Internal Redirect, but in actuality there is no "real" HTTP request or status code. A redirect of this sort is usually caused by HSTS on the server. HSTS is a security feature that Firebase Hosting uses.

In any case, a 307 internal redirect cannot affect SEO because it happens within the browser itself. So unless you are getting some other kind of 307, it's nothing to worry about.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2019-01-31)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。