1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Removing PHP Code from URL - making search engine friendly dynamic URL

Discussion in 'Content Management' started by dweiss, Mar 3, 2006.

  1. #1
    How can I change my displayed links from:

    http://www.mysite.com/links3/jump.php?id=27&url=http://www.linkedsite.com

    to just: http://www.linkedsite.com ?

    I've got a small open source links management program that generates the URLs displayed to visitors in the format:
    http://www.mysite.com/links3/jump.php?id=27&url=http://www.linkedsite.com

    That link is generated by this code:
    print("<div><a href=\"jump.php?id=$rec_id&amp;url=$url\" title=\"Go to the website $name\"><strong>$name</strong></a> - $description</div>");

    where jump.php is a small script that increments a counter for the number of times a link is clicked.

    I'd like to change the code so that the counter still works but that the link the user (and a search engine) sees doesn't have all the extra stuff in it and is only: http://www.linkedsite.com

    I've been told that one solution might be to use mod_rewrite for the URL, but I don't have a clue how to actually use that tool. Can someone please help?

    Thanks,

    -Danny.
     
    dweiss, Mar 3, 2006 IP
  2. sponk

    sponk Peon

    Messages:
    85
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well if you only want to link to the URL alone, the only possibility to track the links would be implementing Javascript.

    However, if you can live with something such as www.yourdomain.com/link/http://www.linkedsite.com, then you can use mod_rewrite by placing a .htaccess file in your root directory.
    A quick sample code is as follows:

    
    RewriteEngine on
    Options +FollowSymlinks
    RewriteRule  ^link/http://([A-Za-z0-9\.\-]+)$ links3/jump.php?id=27&url=http://$1 [L]
    
    Code (markup):
     
    sponk, Mar 3, 2006 IP
  3. websiteideas

    websiteideas Well-Known Member

    Messages:
    1,406
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    130
    #3
    Try this. Add this to a file and name it .htaccess

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule jump(.*)-(.*)\.htm$ /links3/jump.php?id=$1&url=$2

    Then, try this link and see if it worked:
    mysite.com/jump27-http://www.linkedsite.com.htm
     
    websiteideas, Mar 3, 2006 IP
  4. dweiss

    dweiss Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    re: what I can live with: my objective is to clean up the link for search engine purposes, if that helps clarify what I said earlier. In that regard, is:
    www.yourdomain.com/link/http://www.linkedsite.com
    an acceptable format, or are they going to get confused by having the linked site preceeded by my site and subdirectory?

    -Danny.
     
    dweiss, Mar 3, 2006 IP
  5. websiteideas

    websiteideas Well-Known Member

    Messages:
    1,406
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    130
    #5
    Search engines will follow that link and not be "confused" by it.
     
    websiteideas, Mar 3, 2006 IP
  6. honey

    honey Prominent Member

    Messages:
    15,555
    Likes Received:
    712
    Best Answers:
    0
    Trophy Points:
    325
    #6
    I think I know what you are talking about. You need a javascript for onclick event. So, the normal href tag is direct to the URL, but if somebody does actually click on the link, it's a onclick event tracked via the javascript, and passed via the tracking system you currently have in place. I would say look at hotscripts.com and you will find a sample code there for sure that will help you do it. If you are not able to find, pm me and I will try to find it for you.

    I hope that helps.

    You definitely do not need mod_rewrite for what you want to do.
     
    honey, Mar 3, 2006 IP
  7. adstiger

    adstiger Peon

    Messages:
    409
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I used the mod rewrite mentioned above, but I am getting this error: "Error 500. Internel Server Error". When I remove .htaccess file, it works. Please help.
     
    adstiger, Mar 11, 2009 IP
  8. hitravel

    hitravel Peon

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    thanks for sharinge, How to change the url ( /?vw=tours&other_cat=27&id=188&title=$115,Huong%%Hai%%Deluxe%%Junk) to (/tour/188/115,huong-hai-deluxe-junks.html
     
    hitravel, Nov 8, 2010 IP
  9. seotapasojha

    seotapasojha Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #9
    Want to integrate dynamic elements on to your existing static web page? Or wish to make you website more interactive and feature fill? It is time to hire a dedicated PHP developer. PHP is short of Hypertext Preprocessor which is one of the most sought after technology that is relied upon to create dynamic web applications and websites. It is a totally server-side scripting language that is driven by the open source philosophy. The language is highly scalable and most developers enjoy working with PHP. GlobalEmployees, is a India based outsourcing agency that understand the dynamic of web development standards that exists in the market today. Taking cue from there, it presents itself with finest PHP resource for as low as $990 per month. For further details, request a quote today.
    :)
     
    seotapasojha, Nov 28, 2012 IP
  10. seotapasojha

    seotapasojha Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #10
    Hi
    Very instructive new in seo
     
    seotapasojha, Aug 1, 2013 IP