Answer the question
In order to leave comments, you need to log in
How to make a quick redirect?
Hello, tell me there is a script that reads the Url and looks at the parameters in the url, if they are not there, then you need to redirect.
The usual methods Location / href, meta refresh are slow, that is, the page has time to load, partially.
Is there any way to do this instantly? that is, also go through the url, make a check and redirect, if necessary, to a third-party portal, but so that it is many times faster.
Thanks
Answer the question
In order to leave comments, you need to log in
The usual Location ... methods are slow, that is, the page has time to load, partially
They are not slow. The point is where the code that will cause the redirect is located. If it is at the end of the page, then before the code is executed, the page will first (suddenly) be rendered, and then a redirect will occur. If the script is in the head, then the body of the page will not have time to render before the redirect. Read the DOM tutorial.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question