Managing My PHP Redirects

4 replies
Able Warriors,

I am at sea as to how to manage all my PHP redirects
to affiliate products in a single folder. Here is what I mean

I want to create a folder called say, "money".

Inside the "money" folder I will have sub folders like

"moneytreeA"
"moneytreeB"
"moneytreeC"

When accessing "moneytreeA" for example, the link
will look like this:

MakeMoney.com/money/moneytreeA, which should
automatically redirect to that affiliate product sales
page.

I know PHP redirection code that should be in the
sub folders, viz:

"moneytreeA" ie index.php redirection code
"moneytreeB" ie ditto
"moneytreeC" ie ditto

But what content/code should be in the "money" folder's
index file if any, so that there will be seamless
redirection?

Waiting for your replies. Thank you
#managing #php #redirects
  • Profile picture of the author CMartin
    Originally Posted by GoingSomewhere View Post

    Able Warriors,

    I am at sea as to how to manage all my PHP redirects
    to affiliate products in a single folder. Here is what I mean

    I want to create a folder called say, "money".

    Inside the "money" folder I will have sub folders like

    "moneytreeA"
    "moneytreeB"
    "moneytreeC"

    When accessing "moneytreeA" for example, the link
    will look like this:

    MakeMoney.com/money/moneytreeA, which should
    automatically redirect to that affiliate product sales
    page.

    I know PHP redirection code that should be in the
    sub folders, viz:

    "moneytreeA" ie index.php redirection code
    "moneytreeB" ie ditto
    "moneytreeC" ie ditto

    But what content/code should be in the "money" folder's
    index file if any, so that there will be seamless
    redirection?

    Waiting for your replies. Thank you
    I read and re-read your question and I'm not sure what you are asking... if what you want to know is what should be the content/source of the index.php file in the "money" folder (i.e. example.com/money/index.php) it should be blank if it does not perform any redirect... and in this case you should use a blank "index.html" file instead of ".php".

    If that's not what you want to know, please be more specific.

    Carlos
    {{ DiscussionBoard.errors[1777109].message }}
  • Profile picture of the author firstdandy
    Yes, I agree with Bruce. You just use .htaccess for simpler method to do redirection
    {{ DiscussionBoard.errors[1780895].message }}
  • Profile picture of the author kaido
    For simple redirect you can do it like this:create an index.php in your moneytreeA folder with code like this
    PHP Code:
    <?php

    header
    ("Location: YOUR_DESIRED_LINK_HERE");

    ?>
    Signature

    {{ DiscussionBoard.errors[1783128].message }}

Trending Topics