Hi guys, I am really baffled with this thing as I want to develop something using this , but i don't even know what this technology/technique(whatever you say) is called.It is related to .htaccess . Like , http://shrinkthislink.com provide URL shrinking ( everybody here must know this) they provide something like this, http://urlm.in/dbgq So, they are not of course making a folder for every new link and then putting an index.html ( or anything .php , .asp ) in it . I am sure they are using .htaccess for this. I want to learn about this and most importantly what this thing is called. So please tell me the name and give a link to it. Your help will be greatly appreciated.
I looks like URL shortening and you can do it easily with Apache + URLRewriting + PHP + MySQL. You have to store the sequence and the URL it represents into a database. http://urlm.in/dbgq http://urlm.in/dbga http://urlm.in/dbgb -> http://blog.caranddriver.com/freshened-hyundai-santa-fe-bows-in-frankfurt/ http://urlm.in/[B]ddat[/B] -> http://www.drk.com.ar/docs/photos/villa-de-merlo-san-luis-argentina.php URL rewriting will probably convert http://urlm.in/ddat -> http://urlm.in/index.php?id=ddat Then index.php would look up database for ddat ID and redirect you to http://www.drk.com.ar/docs/photos/villa-de-merlo-san-luis-argentina.php
An easy way you can do it with just PHP is, you have PHP get the url of the self page, say it is "http://urlm.in/dbgq" in full. Then, strip out http://urlm.in/ and http://www.urlm.in/ always, and you are left with dbgq, which you could send into a database and pull the url. Make sure you remove all special characters, so nobody can do any sql injection. I did this with a site once, except with numbers site.com/81 site.com/517 And it worked fine, with just php. so it is possible.