Need Help On Redirect Code

4 replies
I want to use a redirect code to send visitors from my articles, directly to some of my offers. Ezine says it has to be from the top level domain.

I have a code to use, which I hope is good.
<?
Header ( "HTTP/1.1 301 Moved Permanently" );
Header ( "Location: http://clickbankid.productname.hop.clickbank.net" );
?>

The writer of the code is a little sketchy, but I think he is saying, if it has to be a top level domain, like mysite.com, at ezine, then the redirect file will have to be index.php Do I edit the one that is already there in my site. I have sites for all these products, but want to see if redirecting will increase sales.

When I clicked on the php file in one of my sites in public_html, my dreamweaver opened, and it seemed like the file was empty, even though the site is completed. I added the redirect code, but it didn't work. I also see there is an index.php file in the wordpress content folder, but I assume I should be editing the public_html index.php folder. Is that right?

I am familiar with playing with this stuff, but would rather get some advice before I mess something up. Thanks in advance.
Glenn
#code #redirect
  • Profile picture of the author thrigrri
    Hi

    Here's a HTML redirect code which you may want to use (this is the one that I'm using to do all redirects as well, and it worked nicely for me):

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta HTTP-EQUIV="REFRESH" content="0; url=INSERT YOUR URL HERE">
    <title>INSERT YOUR TITLE HERE</title>
    </head>

    <body>
    </body>
    </html>


    Copy and paste the code above into Notepad (if you are using a PC).

    You need to replace INSERT YOUR URL HERE with the URL in which you want to redirect to (include the whole URL, including the http://www.), as well as replace INSERT YOUR TITLE HERE with the title of the destination site.

    After you are done with this, go to File -> Save As, and as for file type, select the option all file types (*.*). And name your file index.html.

    Next, you need to upload this file - Go to your FTP program, navigate to the public_html directory (double click to go into it), and upload this index.html there. (Make sure you remove all other redirect PHP files you have done in the past).

    Now, enter your domain's URL... It should work...

    Let me know if you encounter any problems...


    Cheers
    Jun Yuan
    Signature

    Discover Tips On Generating A Massive Income Online - http://www.junyuanlim.com
    Get Top Internet Marketing Products At Hugely Affordable Prices - http://www.internetprofitmachines.com
    Get Great Products Via Tradebit Store - http://internetprofits.tradebit.com

    {{ DiscussionBoard.errors[2542238].message }}
  • Profile picture of the author anthon
    PHP code is better.
    It will also send a http 301 moved header so search engines will know your site is moved.
    Just put that code in the index.php file in the directory where you have installed your website. And also delete index.html file if there is any.
    I am also using similar code in my site which I got from
    Search engine friendly website redirecting using php. | Justtechnika.com
    {{ DiscussionBoard.errors[2542254].message }}
  • Profile picture of the author Bujuk
    Signature
    “Have no fear of perfection - you'll never reach it.”
    - Salvador Dalí
    {{ DiscussionBoard.errors[2542689].message }}
    • Profile picture of the author satrap
      I was in the same situation just a few days ago. I wanted to submit some articles for some of my CPA offer on ezine, but didn't know how to redirect. I did some research and got a simple solution from some of the warriors. It is so simple. Here it is:

      This code is all you need

      <?php
      header( 'Location:YourAffiliateLink.com' ) ;
      ?>



      1- Replace the link (YourAffiliateLink) with your own affiliate link.

      2- Copy and past the code into notepad and save as index.php

      3- Upload this file to your web root (public_html/www) on the domain you want to use for this redirect.
      4- type the domain name in your browser, it should redirect to the offer page.

      Its that simple really. But, when you dont know it (like i dint know it 3 days ago), it seems like a big deal and all the answers confuses you. Simply use the code above and you will be good to go.

      I use this method 2 days ago, and was able to submit 3 article to ezine for 3 different CPA offers (email submit). I already made $25 just from these 3 articles.

      If you come across any problem, feel free to PM me and I will walk you through. Good luck.
      Signature
      60 Awesome Ways to Make Money Without a Job
      .................................
      Check out my blog Survey Satrap featuring honest reviews of paid survey sites.
      {{ DiscussionBoard.errors[2542739].message }}

Trending Topics