Results 1 to 8 of 8

 

Thread: Hiding URL's using ASP?

  1. #1
    WiganWebs's Avatar
    Registered User

    Status
    Offline
    Join Date
    Apr 2007
    Location
    Wigan, UK
    Posts
    182
    Thanks
    1
    Thanked 5 Times in 5 Posts


    Hi,

    I recently purchased hosting using ASP, since moving on from PHP. Dont ask why, I dont know, but I have bought it now.

    I was using a php script that used URL forwarding, it looked like this:

    <?
    $linkid = $_GET['linkid'];
    if ($linkid == "1") {$link = "site.com";}
    header("Location: $link");
    exit();
    ?>


    Does anyone know of a similar code using ASP instead of PHP?

    Thanks
    Terry

  2. #2
    Registered User

    Status
    Offline
    Join Date
    Jun 2005
    Location
    Hampshire, UK
    Posts
    623
    Thanks
    9
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by Tezza View Post
    Hi,

    I recently purchased hosting using ASP, since moving on from PHP. Dont ask why, I dont know, but I have bought it now.

    I was using a php script that used URL forwarding, it looked like this:

    <?
    $linkid = $_GET['linkid'];
    if ($linkid == "1") {$link = "site.com";}
    header("Location: $link");
    exit();
    ?>


    Does anyone know of a similar code using ASP instead of PHP?

    Thanks
    Terry

    You could try using something like this...

    linkid = Request.QueryString("linkid")
    If linkid = 1 Then link = "site.com"
    Response.Redirect(link)

  3. #3
    WiganWebs's Avatar
    Registered User

    Status
    Offline
    Join Date
    Apr 2007
    Location
    Wigan, UK
    Posts
    182
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Ok thanks.

    I cannot fine tune it, I'm pretty decent with PHP but cannot get the asp to work.

    I have tried:

    linkid = Request.QueryString("linkid")
    If linkid = 1 Then link = "site.com"
    Response.Redirect(link)

    Saved it as go.asp

    How would I like to it?

    With PHP it was go.php?linkid=1

    Thanks again
    Terry

  4. #4
    Registered User

    Status
    Offline
    Join Date
    Mar 2005
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    first you need to confirm whether it's ASP/ASPX, and what language you are using, as you can use javascript, VB Script, C# as your script language.

    Assuming regular VBScript driven ASP, then at the top of the redirect file:

    eg. go.asp

    PHP Code:
    <%
        
    linkid Request.QueryString("linkid")
        If 
    linkid 1 Then link "http://site.com"
        
    Response.Redirect(link)
    %> 
    call it with go.asp?linkid=1

    There's more elegant ways, by using SWITCH...CASE etc. but that's the basic, for sure.
    Steve

  5. #5
    Registered User

    Status
    Offline
    Join Date
    Jun 2006
    Posts
    628
    Thanks
    7
    Thanked 70 Times in 67 Posts
    Quote Originally Posted by stevebrowne View Post

    PHP Code:
    <%
        
    linkid Request.QueryString("linkid")
        If 
    linkid 1 Then link "http://site.com"
        
    Response.Redirect(link)
    %> 
    The above code would fail if linkid is anything other than 1 - the code would try to redirect to something that isn't a url. Should be
    If linkid = 1 Then
    link = "http://site.com"
    Response.Redirect(link)
    end if

    Usually for redirects we'd use a select case,
    linkid = Request.QueryString("linkid")
    select case linkid
    case 1
    response.redirect "http://site.com"
    case 2
    response.redirect "http://othersite.com"
    ...etc..

  6. #6
    Affi Liate's Avatar
    Registered User

    Status
    Offline
    Join Date
    Jan 2007
    Location
    A new house with 76 windows, broadband, maid and a clock.
    Posts
    544
    Thanks
    1
    Thanked 61 Times in 25 Posts
    Hi Tezza,

    I was just pouring a glass of
    Stowells White Christmas wine
    whilst purusing the post titles.

    I passively read yours out aloud
    to which (totally un-prompted) one
    of my code geeks replied;

    "Sounds like a bad idea to me..."

    If you would like me to sober him
    up and get him to elaborate, please
    let me know...

    Affi New Year

  7. #7
    WiganWebs's Avatar
    Registered User

    Status
    Offline
    Join Date
    Apr 2007
    Location
    Wigan, UK
    Posts
    182
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Thank you for the replies, I am on a different Laptop now (my daughters) so I shall try that tomorrow.

    Unfortunatly coding is not a strength of mine, although I make up for it on SEO and ideas, at least I try, hehe.

    I changed to ASP.net hosting because I wanted to try a shopping.com API script that I have found, but it means me now transfering 30+ domains Silly mistake! I guess I was tired when I did it . I could still use URL masking too, I suppose that is another way around it. I only get multi domain hosting for 6 months anyway so maybe will swap back when it is time to expire.

    Dont get too drunk Affi, save the hangovers for xmas Nothing worse than trying to think on a hangover

    JonSP, luckily I use only 1 referral URL per landing page/domain, at least on most of my sites I do, so I guess that should be okay? Its just that on one or two sites I use more than 1 deep link.

    Thanks again guys, help is much appreciated.
    Terry

  8. #8
    Registered User

    Status
    Offline
    Join Date
    Mar 2007
    Location
    Liverpool
    Posts
    728
    Thanks
    3
    Thanked 16 Times in 13 Posts
    Hi Terry

    Can you not use a masked redirect so the URL never changes.
    Or just a frame, although G will still spider all pages without.. (Idea : You could write a very quick "If no frame then grab frame script", literally about 4 lines of code.)

    Hope this helps.



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Hiding Affiliate Link URL's?
    By ian-d in forum Affiliate Marketing Lounge
    Replies: 52
    Last Post: 06-12-08, 12:14 PM
  2. Replies: 3
    Last Post: 26-02-07, 05:12 PM
  3. Replies: 0
    Last Post: 26-02-07, 03:15 PM
  4. hiding urls
    By Nikki in forum Affiliate Marketing Lounge
    Replies: 6
    Last Post: 18-08-06, 11:46 PM
  5. Scraper site including my urls
    By EyeOfTheTiger in forum Affiliate Marketing Lounge
    Replies: 5
    Last Post: 29-07-05, 12:37 PM

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
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2