Managing My PHP Redirects

by 4 replies
5
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
#programming #managing #php #redirects
  • 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
    • [1] reply
  • Yes, I agree with Bruce. You just use .htaccess for simpler method to do redirection
  • 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");

    ?>

Next Topics on Trending Feed