| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #2 (permalink) |
| Account Closed Join Date: Jul 2005
Posts: 176
![]() | Ok, heres an idea ,if you want to have it be like USER.zsr.us then you need to set up wildcard subdomains (Wild Card DNS i think its called) in Apache. Then you need to set up URL rewriting in the .htaccess file. And then foward USER.zsr.us to like zsr.us/url.php?id=USER. Then on url.php You need to query your db of the user's actual URL, then header foward to that URL. |
| |
| | #3 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | All you need to do is get the URL the person wants a short link for, input that into the database along with a random unique string (you could use the id number that you would use in your database for the url but that could possibly start getting big, with unique random strings they at least can be used again when the old link is redundant and deleted) Of course return the link to the person so they know what it is. when someone clicks the link (which would obviously have a variable in it) you need to select the URL from the database (obviously after checking the variable has not been tampered with) and do a header redirect to the url you have just received from the DB.
__________________ Manage your portfolio using my new Domain Portfolio Management script. Securing Your Domain Name From Theft |
| |
| | #5 (permalink) | ||||||||
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
????: NamePros.com http://www.namepros.com/programming/122623-short-url-service-how.html if you want it just to be like zsr.us/idnumber as if it was another folder on your site then you will need to do some trickery such as a custom 404 page so when it fails it sees if the folder nane is ina format you would expect it to be in then use header redirect then if not then just throw a 404 page as ussual.
__________________ Manage your portfolio using my new Domain Portfolio Management script. Securing Your Domain Name From Theft | ||||||||
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| soooo many yahoo's | redhippo | Domain Name Discussion | 5 | 07-13-2005 12:26 AM |
| Want to start your own short url service? | axilant | For Sale / Advertising Board | 0 | 05-03-2005 05:02 PM |
| free subdomain/ short url redirect | geekpipe | Free Resources | 4 | 07-16-2004 05:56 PM |