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

302 response code isn't causing redirect

· 52CE 我爱测

I'm looking at a page where the server is returning response code 302, and the URL pointed towards is the exact same. In other words, it's redirecting towards itself. The page does not redirect, nor does it create a redirect loop…

问题原文

原帖链接 · Aromefraise · CC BY-SA 4.0

I'm looking at a page where the server is returning response code 302, and the URL pointed towards is the exact same. In other words, it's redirecting towards itself.

The page does not redirect, nor does it create a redirect loop, which I would expect to happen when a page redirect to itself.

Any insight on why this happen? Why is there not a loop happening? Example URL: https://norefjellskiogspa.no/aktiviteter/

已采纳解答

原帖链接 · xngtng · CC BY-SA 4.0

The page linked gives following response:

HTTP/1.1 302 Found
Date => Tue, 29 Mar 2022 11:58:24 GMT
Content-Type => text/html; charset=UTF-8
Content-Length => 74528
Connection => close
Server => Apache/2.4.38 (Debian)
X-Powered-By => PHP/7.3.31-1~deb10u1
Vary => Accept-Encoding,Cookie,User-Agent
Cache-Control => max-age=3, must-revalidate, max-age=2592000
Last-Modified => Tue, 29 Mar 2022 11:32:28 GMT
Expires => Thu, 28 Apr 2022 11:58:24 GMT

The Location header does not exist and therefore there is no redirection to any location.

the URL pointed towards is the exact same. In other words, it's redirecting towards itself.

So this is not true. It is not redirecting to anywhere.

It is probably just the default code used, not necessarily "correctly", because URL rewriting is enabled.

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

资料来源与适用范围

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

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

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