Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

How can I set up a auto-redirect from one site to another?

I have a website that I recently setup and have running, but I want people to be able to type in www.thisonefirst.com and end up on www.thisonesecond.com (both are fake)...

Can anyone help? If you need more information, ask for it!

2 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    There's various ways to do this, you can use :

    HTML :

    <meta http-equiv="refresh" content="2; url=http://www.thisonesecond.com">/

    Javascript :

    <script type="text/javascript">

    <!--

    window.location = "http://www.thisonesecond.com/%22

    //-->

    </script>

    Both those html and javascript methods are a bit slow and clunky, you have to wait for the page to load before you get redirected.

    A far better method is to send a '301 moved' http header, you can do this with server side scripting, such as php

    <?

    header ('HTTP/1.1 301 Moved Permanently');

    header ('Location: http://www.thisonesecond.com');/

    ?>

    That will send a 301 Moved header to the browser, the browser will then go off to the new location.

    Another method is to use a .htaccess file with apache (assuming your web server is apache that is) to do the 301 trick, this has the advantage of forwarding any page on your old site to the new site. Create a file called .htaccess containing

    RewriteEngine On

    Redirect 301 / http://www.thisonesecond.com/

    A benefit of the '301' method is that search engines such as google will take note of the '301 Moved' header and update their results to point to the new site.

  • 1 decade ago

    <html>

    <head>

    <title>Meta Redirect Code</title>

    <meta http-equiv="refresh" content="5;url=http://www.somewhereelse.com">/

    </head>

    <body>

    Your browser will be automatically redirected to the new site.

    </body>

Still have questions? Get your answers by asking now.