acha ji
This is a sum up of every previous answers plus an additional solution using HTTP Refresh Header via .htaccess
1. HTTP Refresh Header
First of all, you can use .htaccess to set a refresh header like this
This is the "static" equivalent of using the
header() function in PHP
Note that this solution is not supported by every browser.
2. JavaScript/jQuery
With an alternate URL:
Without an alternate URL:
Via jQuery:
3. Meta Refresh
You can use meta refresh when dependencies on JavaScript and redirect headers are unwanted
With an alternate URL:
Without an alternate URL:
Using
<noscript> :
Optionally
As recommended by Billy Moon, you can provide a refresh link in case something goes wrong:
If you are not redirected automatically:
<a href='http://example.com/alternat_url.html'>Click here</a>
Resources
| |||
25
|
It would be better to set up a 301 redirect. See the Google's Webmaster Tools article 301 redirects.
| ||||||||||||||||
|
setTimeout
with a string. Pass a function instead. – Oriol Nov 28 '16 at 20:07