NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Short URL service. How?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 09-10-2005, 05:56 PM THREAD STARTER               #1 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
 


Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)

Smile Short URL service. How?


Hi,

I am making a short URL service (ZSR.us).

How do I do it? lol

Thanks,
-Matt
mholt is offline  
Old 09-10-2005, 10:02 PM   #2 (permalink)
Account Closed
Join Date: Jul 2005
Posts: 176
cbr600 is on a distinguished road
 



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.
cbr600 is offline  
Old 09-11-2005, 05:36 AM   #3 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,069
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
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
Peter is offline  
Old 09-11-2005, 05:25 PM THREAD STARTER               #4 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
 


Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Thanks for the ideas!

Suppose I just want it to be accessable like zsr.us/idnumber

or,

zsr.us/sitename

How can I do THAT? What is URL rewriting with the .htaccess file?
mholt is offline  
Old 09-11-2005, 06:14 PM   #5 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,069
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
Originally Posted by compuXP
What is URL rewriting with the .htaccess file?
you will only need that if it is going to be as a subdomain.

Originally Posted by compuXP
Thanks for the ideas!

Suppose I just want it to be accessable like zsr.us/idnumber

or,

zsr.us/sitename

How can I do THAT?
i suppose the easiest way as mentioned in my previous post would be to insert the url into the database. The table would have a id number (auto increment) and url. When you have inserted the url retrieve the id number for that url and return that to the customer as part of the url.
????: 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
Peter is offline  
Closed Thread


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

Liquid Web Smart Servers  
All times are GMT -7. The time now is 10:52 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger