3

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/

1 Answer 1

5

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.

2
  • That explains the lack of redirect loop. I'm unsure of the last comment regarding default code because of enabled URL rewriting. Can you elaborate? Haven't crawled this particular site, but some tested are not causing this problem. Mar 29, 2022 at 13:45
  • @Aromefraise "because of enabled URL rewriting." - The 3xx response code and missing Location header can result from "errors" in the .htaccess file or Apache config. If, for instance, you issue an external redirect using mod_rewrite but fail to use the L flag and the request then gets internally rewritten - you can get responses like this. If this is still an issue then edit your question to include your complete .htaccess file (or relevant Apache config).
    – MrWhite
    Mar 31, 2022 at 1:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.