Skip to main content
Known Participant
March 6, 2017
Answered

show page and then redirect after seconds to another page

  • March 6, 2017
  • 3 replies
  • 1706 views

I have a client who wants to have a page telling Customers that his address has changed.  Then after a few seconds, then his home page appears.  Any simple ideas?

Thanks.

Don

This topic has been closed for replies.
Correct answer pziecina

Don't use a redirect, as the browser will show a warning that the page is trying to re-direct.

Instead use a modal window.

3 replies

OhAdobeYouSoCrazy
Inspiring
March 6, 2017

Note sure if this is 100% browser compliant, but works on just about everything I use it for. Note: The "proper" way to redirect an old address to a new address would be via a 301 redirect in your .htaccess file. This will make sure your Google serps aren't affected. However, that wouldn't give you the 5 second delay, it would just redirect immediately. Up to you and your client to decide if you want a better user experience, or better google serps.

<!doctype html>

<html lang="en">

<head>

<meta charset="utf-8">

<title>My Redirect Page</title>

</head>

<body>

<div>

     You will be redirected in 5 seconds...

</div>

<script type="text/javascript">

setTimeout(function(){

     window.location.replace("http://www.google.com");

}, 5000);

</script>

</body>

</html>

Nancy OShea
Community Expert
Community Expert
March 6, 2017

PZ is right.  Page re-directs should be avoided.   Google doesn't like them.

A short intro might be all you need.

Bootstrap with SVG Intro

Nancy

Nancy O'Shea— Product User & Community Expert
pziecina
pziecinaCorrect answer
Legend
March 6, 2017

Don't use a redirect, as the browser will show a warning that the page is trying to re-direct.

Instead use a modal window.