SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: Page Redirect

  1. #1
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    532
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question 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?
    thanks
    Will

  2. #2
    SitePoint Wizard
    Join Date
    Dec 2003
    Location
    USA
    Posts
    2,582
    Mentioned
    29 Post(s)
    Tagged
    0 Thread(s)
    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=http://www.mysite.com/">

    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.

  3. #3
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    532
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  4. #4
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    To avoid confusion basically.
    Ryan B | My Blog | Twitter

  5. #5
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,822
    Mentioned
    110 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by silversurfer5150 View Post
    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?
    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.

  6. #6
    SitePoint Wizard
    Join Date
    Dec 2003
    Location
    USA
    Posts
    2,582
    Mentioned
    29 Post(s)
    Tagged
    0 Thread(s)
    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.

  7. #7
    SitePoint Addict AtSea webdesign's Avatar
    Join Date
    May 2010
    Location
    Newark, Delaware
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

    Do you have access to your .htaccess file?

  8. #8
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    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. If you have more tech-savvy clients, you won't need to go to these lengths.)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •