How to create a dynamic page that looks like a regular page?

Discussion in 'PHP' started by rolf, Mar 4, 2009.

  1. #1
    Hey guys,

    I know how to create a dynamic page with dynamic affiliate links and content dependent on parsing the url using GET.

    e.g.

    http://digitalpoint.com/?id=bob
    http://digitalpoint.com/?id=ben
    http://digitalpoint.com/?id=fred

    and then each page will have affiliate links like:

    tinyurl.com/bob
    tinyurl.com/ben
    tinyurl.com/fred


    But my problem is that the resulting url contains question marks ("?") in the url.

    Sure, I know how to use .htaccess to convert the source urls:

    e.g.

    http://digitalpoint.com/?id=bob
    to
    http://digitalpoint.com/bob

    so it looks more clean. I know how to do this. But the problem is that this is a redirect. The final URL is still "http://digitalpoint.com/?id=bob" It still has this pesky question mark.

    I would like to get rid of it.

    Let me show you an example here of a site that someone has made:

    http://revator.com/fred-review/beat-eczema.html
    http://revator.com/bob-review/beat-eczema.html
    http://revator.com/ben-review/beat-eczema.html

    You can see here that it is totally dynamic, the banner links are rewritten for fred or bob or ben, BUT it just looks like a regular site. Any idea how to program this in PHP?

    thanks
     
    rolf, Mar 4, 2009 IP
  2. Syndrom

    Syndrom Peon

    Messages:
    89
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You need to use htaccess and mod_rewrite.
    And no it is not a redirect than.
     
    Syndrom, Mar 4, 2009 IP
  3. rolf

    rolf Active Member

    Messages:
    1,449
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    90
    #3
    Thanks for that!

    Looking into it now.

    Cheers mate
     
    rolf, Mar 4, 2009 IP
  4. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you just want http://blahblah/bob then you may also be able to do it by using $_SERVER['PATH_INFO']. Check and see if you get anything meaningful in there when sticking an extra /whatever on the end of your URL. It depends on server configuration.
     
    SmallPotatoes, Mar 4, 2009 IP
  5. Sipifi

    Sipifi Well-Known Member

    Messages:
    530
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    155
    #5
    Sipifi, Mar 8, 2009 IP