Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Redirect Traffic

  1. #1
    Join Date
    Oct 2007
    Posts
    47
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Redirect Traffic

    Hello there

    Can anyone tell me the easiest way of redirecting traffic from my website at one url to another. Apart from the change of web address the website is exactly the same.

    Thanks

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    HTML Code:
    <h1><a href="http://www.newlocation.com/">We've moved!. Click here if you're not redirected...</a></h1>
    <script type="text/javascript">
    setTimeout(function() { window.location='http://www.newlocation.com/'; },3000);
    </script>
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    Oct 2007
    Posts
    47
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    thanks techsupport - spot on

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    .htaccess would be better though. Although tech did include the fall back, click here link.

    in .htaccess:

    Code:
    RedirectMatch permanent ^/page.html$ http://site.com/new.html
    all on one line. red code is old page/site/etc/ blue is new one.
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    Dec 2007
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I like to use
    Code:
    <meta 
    http-equiv="refresh" content="0; url=your new address.html">

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,127
    Thanks
    44
    Thanked 3,228 Times in 3,189 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Briggs View Post
    I like to use
    Code:
    <meta 
    http-equiv="refresh" content="0; url=your new address.html">
    Though this is the only truly HTML way to do this, like the javascript solution, that can be turned off or fail. So, also like the javascript solution, an actual link to the new page should be present. Server side redirects are best if available. These can be accomplished in addition to in the .htaccess file, by using PHP, asp, and other server side languages.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Quote Originally Posted by Briggs View Post
    I like to use
    Code:
    <meta 
    http-equiv="refresh" content="0; url=your new address.html">
    That's now deprecated.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  8. #8
    Join Date
    May 2007
    Location
    England, UK
    Posts
    235
    Thanks
    3
    Thanked 6 Times in 6 Posts

    Default

    If you use PHP just create an index.php page and add the following line:
    PHP Code:
    <?php header('Location: http://www.yoursite.com/'); ?>

  9. #9
    Join Date
    Oct 2007
    Posts
    47
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    I've tried various of the options above and am finding that the site im forwarding traffic to is fine in Internet Explorer but in Firefox is opening the ftp page (ie. showing the html)? What have I done wrong???
    Thanks
    H

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,127
    Thanks
    44
    Thanked 3,228 Times in 3,189 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by hamfast View Post
    I've tried various of the options above and am finding that the site im forwarding traffic to is fine in Internet Explorer but in Firefox is opening the ftp page (ie. showing the html)? What have I done wrong???
    Thanks
    H
    Sounds like the mime type from the server of the new site is wrong.

    If you navigate directly to the new page in FF, does it still display the source code, or is the page then shown correctly? If FF shows the page correctly, what methods did you try, and how did you implement them? If not, the mime type needs to be changed on the server.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •