Results 1 to 3 of 3

Thread: redirect short url to a long url.

  1. #1
    Join Date
    Apr 2008
    Location
    Little Office!
    Posts
    80
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default redirect short url to a long url.

    we have a long url which we send to users in email and sometimes they have problems clicking it. so, we want to shorten the url to something in few characters.


    long url: index.php?option=vm&page=downloads&product_id=6&file_name=soft.exe&id=XXXX

    the XXXX will be the download id per customer.

    short url: www.oursite.com/pdownload?XXXX

    is there a htaccess redirect we can do here??

    Thanks

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    I haven't worked with htaccess but you could use php headers

    at the start of this page www.oursite.com/?pdownload=XXXX put in

    Code:
    <?php
    if (!empty($_GET['pdownload']))
    header("Location: index.php?option=vm&page=downloads&product_id=6&file_name=soft.exe&id=" . $_GET['pdownload']);
    else
    echo "Missing Parameter for file.";
    ?>
    Corrections to my coding/thoughts welcome.

  3. #3
    Join Date
    Apr 2008
    Location
    Little Office!
    Posts
    80
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    THANK YOU!!! DD rocks like always.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •