[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

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


Closed Thread
 
LinkBack Thread Tools
Old 09-10-2005, 04:56 PM   #1 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

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
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 09-10-2005, 09:02 PM   #2 (permalink)
Account Closed
 
Join Date: Jul 2005
Posts: 176
26.00 NP$ (Donate)

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, 04:36 AM   #3 (permalink)
Senior Member
 
Peter's Avatar
 
Join Date: Nov 2003
Location: Scotland
Posts: 4,900
0.60 NP$ (Donate)

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, 04:25 PM   #4 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

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?
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 09-11-2005, 05:14 PM   #5 (permalink)
Senior Member
 
Peter's Avatar
 
Join Date: Nov 2003
Location: Scotland
Posts: 4,900
0.60 NP$ (Donate)

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
Quote:
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.

Quote:
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.

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
soooo many yahoo's redhippo Domain Name Discussion 5 07-12-2005 11:26 PM
Want to start your own short url service? axilant For Sale / Advertising Board 0 05-03-2005 04:02 PM
free subdomain/ short url redirect geekpipe Free Resources 4 07-16-2004 04:56 PM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 03:35 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85