Quantcast
Viewing latest article 20
Browse Latest Browse All 51

Answer by Billy Moon for How to redirect one HTML page to another on load

I would use both meta, and JavaScript code and would have a link just in case.

<!DOCTYPE HTML><html lang="en-US"><head><meta charset="UTF-8"><meta http-equiv="refresh" content="0; url=http://example.com"><script type="text/javascript">            window.location.href = "http://example.com"</script><title>Page Redirection</title></head><body><!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->        If you are not redirected automatically, follow this <a href='http://example.com'>link to example</a>.</body></html>

For completeness, I think the best way, if possible, is to use server redirects, so send a 301 status code. This is easy to do via .htaccess files using Apache, or via numerous plugins using WordPress. I am sure there are also plugins for all the major content management systems. Also, cPanel has very easy configuration for 301 redirects if you have that installed on your server.


Viewing latest article 20
Browse Latest Browse All 51

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>