Page Redirect

Hey folks,

I have been developing for a while now and it recently occured to me that I am unsure of what is happening when a page comes up with “you are being redirected to another page - please click here if you are not redirected automatically”. I have used .htacess files before to redirect from index to something with a more SEO friendly name, is this what is happening here. Could anyone clarify this for me?

Nope, it is actually an HTML meta (usually… it can also be done with Javascript, but that’s a bit sloppy).

The syntax looks like this:
<meta http-equiv=“refresh” content=“10;url=”>

Where 10 is the number of seconds to wait.

The .htaccess redirects are server-side and done before anything is every actually sent to the user.

Good question.

Thanks for that ;), I get the technical side of it now but why would you want to hold off on diverting someone for 10 secs?

To avoid confusion basically.

It’s often used to make it clear to the visitor that the website has moved, which might encourage them to update their bookmarks or any links. It also reduces any confusion or flicker caused by an almost-instant load and change.

It isn’t a good idea - 301/302 redirects are a far better choice.

Yeah… I agree with Stevie D… it isn’t a good idea.

I commonly see it in places like log-in sections of forums. However, it’s just a waste of transfer and the users time to actually put that in place. if they just submitted a log-in form and they were taken where they expected, they can probably figure out they were just logged in.

As Stevie said it’s better to use a 301 redirect. That way if the user types in the old URL they will be forwarded to the new site. Chances are they’ll never know they’ve been redirected. :slight_smile:

Do you have access to your .htaccess file?

The only time I use them is for very temporary situations. For example, I put one up today on a demo site I’m doing for a client. The URL they have is to an obsolete demo. Instead of sending them a new URL and going through the “Why doesn’t the [old] link work?” thing, I just redirected them to the new URL using the meta redirect. I’ll take it down in a few days and no one will be discomfited or confused. The redirect page takes 1 second to redirect, and has the word “Redirecting …” on it as its only content.

(First question from one of the client organization’s members: “I don’t like the site address, it doesn’t reflect who we are.” The site URL was to a demo page on my site. :stuck_out_tongue: If you have more tech-savvy clients, you won’t need to go to these lengths.)