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&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.
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):
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
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.
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.
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.
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
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.