0

I need to ask if there is any way to auto redirect without showing as 301 or 302 status in the network.

I found i solution with JS:

<script>window.location.replace(url);</script>

But the problem is when the URL with no content 204 the not redirected, and I need to make the redirect anyway.

  • 3
    Why do you oppose 3xx status codes? – Niet the Dark Absol Jul 18 '21 at 14:28
  • If you want to redirect in HTTP, you use the 3xx status codes. If you want to redirect in HTML, you use a meta refresh header. If you want to redirect in JavaScript, you use the location property. That’s all that I can think of. – Chris Haas Jul 18 '21 at 14:43
  • What HTTP code does `window.location` provide? – evolutionxbox Jul 18 '21 at 14:45
  • HTTP code 301 mean Moved Permanently redirect status response code, and 302 mean found redirects. The main problem is I don't want to display those codes when the redirect happens, I need to show it as 200 code status!! please help me if there is any parametter or code to use – BIDARINE Kawtar Jul 18 '21 at 16:48
  • https://stackoverflow.com/questions/31480743/how-to-get-the-status-code-of-the-page-before-it-is-loaded – Shkar Sardar Jul 18 '21 at 16:50
  • Question: if it's possible to force redirect even it's no content found "204 status", i tried to search about that but nothing!!! – BIDARINE Kawtar Jul 18 '21 at 17:02

0 Answers0