.htaccess newbie needing help with this unique subdomain redirection including query

Discussion in 'Apache' started by Orcina, Dec 21, 2011.

  1. #1
    Hello all,


    I've asked for help on my webhost (Hostgator) and unfortunatley they can't even help because 'its outside their support knowledge' that shocking! :eek:
    So i've searched arround the websites on Google, most of them are just wayyyyyyyy to verbose , so my head couldn't simply digest that kind of info.


    I would like to add that i can do this easily via PHP. But i want to 'delete' the subdomain because i've moved certain data to subdomain 2.


    So here goes, how do i do this:


    --> User from Google Search visits OldSubdomain.mysite.com/?l=http://tinypic.com/r/1z18dmp
    --> Apache .htacess must rewrite/redirect from here oldsubdomain.mysite.com/?l=querystring ----> newsubdomain.mysite.com/?link=SAME-QUERY-STRING


    Just to clarify a few things.
    l <--is the letter L (small caps) only used in OLD subdomain.
    link <-- is the word used in NEW subdomain.
    query string <---must be the same when redirecting.
    ImageSite <---my site is a photosharing forum, so my php script in the subdomain retrieves data from tinypic/hotimg based on URL string after the equals (=)
    http:// or no-http:// <--sometimes query string will be like this /?l=tinypic.com (there is not http but php-script will add http during proccessing, so don't worry)




    Examples again:


    Before ---
    OldSubdomain.mysite.com/?l=http://tinypic.com/r/1z18dmp
    OldSubdomain.mysite.com/?l=tinypic.com/r/1z18dua (Different query && WITHOUT "http://" prefix)
    OldSubdomain.mysite.com/?l=http://www.hotimg.com/image/cpqspWC (Dirrent remote image site..)


    After --
    NEWSubdomain.mysite.com/?link=http://tinypic.com/r/1z18dmp
    NEWSubdomain.mysite.com/?link=tinypic.com/r/1z18dua (Different query && WITHOUT "http://" prefix)
    NEWSubdomain.mysite.com/?link=http://www.hotimg.com/image/cpqspWC (Dirrent remote image site..)








    That is all, so i hope someone can assisst me with this & thanks is given in advance
    :)
     
    Orcina, Dec 21, 2011 IP
  2. Orcina

    Orcina Greenhorn

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    I thought i would bump this, incase it was overlooked, but anyway...has anyone had a luck in solving my problem ? :confused:
     
    Orcina, Dec 28, 2011 IP