Quantcast
Channel: How to redirect one HTML page to another on load - Stack Overflow
Browsing all 51 articles
Browse latest View live

Answer by Billy Moon for Redirect from an HTML page

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"...

View Article


Answer by Peter Olson for Redirect from an HTML page

The following meta tag, placed between inside the head, will tell the browser to redirect:<meta http-equiv="Refresh" content="seconds; url=URL"> Replace seconds with the number of seconds to wait...

View Article


Answer by Czechnology for Redirect from an HTML page

You could use a META"redirect":<meta http-equiv="refresh" content="0; url=http://new.example.com/address" />or JavaScript redirect (note that not all users have JavaScript enabled so always...

View Article

Answer by amit_g for Redirect from an HTML page

JavaScript<script type="text/javascript"> window.location.href = "http://example.com";</script>Meta tag<meta http-equiv="refresh" content="0;url=http://example.com">

View Article

Answer by Valerij for Redirect from an HTML page

Try using:<meta http-equiv="refresh" content="0; url=http://example.com/" />Note: Place it in the head section.Additionally for older browsers if you add a quick link in case it doesn't refresh...

View Article


Redirect from an HTML page

Is it possible to set up a basic HTML page to redirect to another page on load?

View Article

Answer by Paul Ogilvie for How to redirect one HTML page to another on load

As far as I understand them, all the methods I have seen so far for this question seem to add the old location to the history. To redirect the page, but do not have the old location in the history, I...

View Article

Answer by Vanquished Wombat for How to redirect one HTML page to another on load

This is a redirect solution with everything I wanted, but I could not find in a nice clean snippet to cut & paste.This snippet has a number of advantages:lets you catch and retain any querystring...

View Article


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

<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Redirect to a page</title></head><body...

View Article


Answer by pat capozzi for How to redirect one HTML page to another on load

Just use the onload event of the body tag:<body onload="window.location = 'http://example.com/'">

View Article

Answer by Yash Jain for How to redirect one HTML page to another on load

You don't need any JavaScript code for this. Write this in the <head> section of the HTML page:<meta http-equiv="refresh" content="0; url=example.com" />As soon as the page loads at 0...

View Article

Answer by Vô Vị for How to redirect one HTML page to another on load

You can auto redirect by HTTP Status Code 301 or 302.For PHP:<?php Header("HTTP/1.1 301 Moved Permanently"); Header("Location: http://www.redirect-url.com");?>

View Article

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

Razor engine for a 5 second delay:<meta http-equiv="Refresh" content="5; url=@Url.Action("Search", "Home", new { id = @Model.UniqueKey }))">

View Article


Answer by Patartics Milán for How to redirect one HTML page to another on load

If you are looking forward to follow modern web standards, you should avoid plain HTML meta redirects. If you can not create server-side code, you should choose JavaScript redirect instead.To support...

View Article

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

I found a problem while working with a jQuery Mobile application, where in some cases my Meta header tag wouldn't achieve a redirection properly (jQuery Mobile doesn't read headers automatically for...

View Article


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

As soon as the page loads, the init function is fired and the page is redirected:<!DOCTYPE html><html><head><title>Example</title><script> function init() {...

View Article

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

I use a script which redirects the user from index.html to relative url of Login Page<html><head><title>index.html</title></head><body...

View Article


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

This is a sum up of every previous answers plus an additional solution using HTTP Refresh Header via .htaccessHTTP Refresh HeaderFirst of all, you can use .htaccess to set a refresh header like...

View Article

Answer by P. BANERJEE for How to redirect one HTML page to another on load

The simple way which works for all types of pages is just to add a meta tag in the head:<html><head> ...<meta HTTP-EQUIV="REFRESH" content="seconds; url=your.full.url/path/filename">...

View Article

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

You should use JavaScript. Place the following code in your head tags:<script type="text/javascript"> window.location.assign("http://www.example.com")</script>

View Article
Browsing all 51 articles
Browse latest View live


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