Enter This Contest And Win A NEW Corvette!
Powered by MaxBlogPress  


How to Redirect to New Page using html, php, asp and javascript

Why do you need to redirect your page? everyone have their own reason, My reason are to redirect to new page is to hide affiliate links and to make it more professional and allow user to redirect to a new page while my current page is not available without having user click continue or seeing 404 error page. You can create redirection page using:

  • HTML: use meta HTTP-EQUIV
    copy the meta code below between head html tags like sample below

    <head>

    <meta HTTP-EQUIV=”REFRESH” content=”0; url=http://www.yourwebsite.com/newpage.html”>

    </head>

    The above HTML code will redirect your user to new web page, and also you can change set the wait time before it redirect into the new page by changing the value of content=”0;

  • PHP using header function
    in you php file such as redirect.php put the following code

    <?php
    header( ‘Location: http://www.youraffiliate.com/index.html’ ) ;
    ?>

    make sure that you did not put any html code in php file as this usually generate error.

  • ASP using Respond.Redirect
    in your asp file paste the following code

    <% Response.Redirect(”/yournewpage.asp”) %>

  • Javascript using window.location
    place this code between head tag

    <head>
    <script language=”JavaScript”>
    window.location=” http://www.youraffiliate.com/index.html”;
    </script>
    </head>

Popularity: 8% [?]