Redirect That Page

Do you ever change your mind? I do. Sometimes I even like to change the name of my website. But how can people get to it then? what if there are links to my pages. They would be broken. With a simple page redirect, you can change your links and still have the name you want!

what we are going to use is called a meta tag. It goes in the head of your html document and is simple to use.

we are going to create a basic html page.

put a message on the page letting the user know they are being redirected.

and put the meta tag in the head and set the time limit.

Our basic page:

<Doctype! html>
<html>
<head>
<title>Page Redirecting</title>
</head>
<body>
</body>
</html>

Now add our message. I’ll make it simple for this example.

<Doctype! html>
<html>
<head>
<title>Page Redirecting</title>
</head>
<body>
You are being redirected to <a href="http://example.com">http://example.com</a>
</body>
</html>

now we will add the actual meta tag:

<Doctype! html>
<html>
<head>
<meta http-equiv="refresh" content="5;url=http://example.com" />
<title>Page Redirecting</title>
</head>
<body>
You are being redirected to <a href="http://example.com">http://example.com</a>
</body>
</html>

Inside the meta tag you notice a 5 at the beginning of the content attribute. this is the delay timer (seconds) before your page changes. Then next comes the url of the page you want to redirect to.

That’s all there is to it!

-ZacDavidMccreary

Advertisements

~ by zacdavidm on October 15, 2012.

 
%d bloggers like this: