How to stop website redirection
Error: redirect error
The accessed website redirects the request in such a way that it can never be completed.
This problem can sometimes occur when cookies are disabled or refused.
... and Google Chrome:
This page doesn't work
example.com redirected you too many times.
Delete your cookies.
Both browsers indicate a cause of the error in their error messages: websites that redirect to themselves until a cookie is set. Browsers in which cookies are deactivated end up in an endless redirect.
In addition, there are incorrect redirects, such as the following redirect directive in the .htaccess file:
This results in an endless redirect https://example.com/foo -> https://example.com/foo/bar -> https://example.com/foo/bar/bar -> ...
It would be better to forward it here with mod_rewrite:
The $ delimiter ensures that no characters can follow “/ foo” in the path, so that https://example.com/foo/bar is no longer forwarded.
In another example, static URLs are generated using mod_rewrite, e.g. example.com/foo is internally rewritten to example.com/index.php?bar=foo:
In addition, conversely, visitors and search engines should be redirected from the old dynamic URLs to the new static URLs:
Both together now ensure endless forwarding.
This can be solved by first installing the 301 forwarding and giving it an L (ast) flag, which prevents the following rules from being executed in the event of a match. However, the forwarding is wrongly activated in a second pass if the query string bar = foo is appended in a first pass through the internal redirection. This can be prevented by an additional check on the request, which is not changed by other rules:
Since browsers load old 301 redirects from their cache, the browser cache may also have to be cleared so that the infinite redirect is fixed (see also this blog post)
- What is Todd Rundgren's most successful song
- Has someone sued a hospital and won?
- Control hormones over sexual behavior
- Why can retail therapy be dangerous
- How important are philosophers in our society
- Why do I feel mentally uncomfortable?
- What's your favorite clean song
- Can we remove a co-founder?
- Which Indian Punjabi films cost the most
- What is the desktop on your computer
- Is human nature a myth
- Is science good for human evolution
- How can I support Torah study
- What exactly was Project Stargate
- What are the characteristics of an engineer
- Think judgment is needed
- Which animal has the simplest nervous system?
- What is another name for a poet?
- Where is Nnamdi Kanu
- How do you say born in Indonesian?
- Why is biology so important
- All airlines have training simulators
- Are there any beginner's algorithms online
- Chronic laryngitis is painful