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

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

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

Just for good measure:<?phpheader("Location: http://example.com", true, 302);exit;?>Make sure there are no echo's above the script otherwise it will be...

View Article


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

It would be better to set up a 301 redirect. See the Google's Webmaster Tools article 301 redirects.

View Article

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

I would also add a canonical link to help your SEO people:<link rel="canonical" href="http://www.example.com/product.php?item=swedish-fish"/>

View Article


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

Place the following code between the <HEAD> and </HEAD> tags of your HTML code:<meta HTTP-EQUIV="REFRESH" content="0; url=http://example.com/index.html">The above HTML redirect code...

View Article

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

Put the following code in the <head> section:<meta http-equiv="refresh" content="0; url=http://address/">

View Article

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

View Article

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

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 How to redirect one HTML page to another on load

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 How to redirect one HTML page to another on load

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 How to redirect one HTML page to another on load

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

View Article

How to redirect one HTML page to another on load

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

View Article

Browsing latest articles
Browse All 51 View Live




Latest Images