Page 1 of 1

Handeling http://site.com/xyz urls

Posted: Sun Aug 23, 2009 5:20 am
by sina_saeedi82
Hi, I'm a newbie PHP coder. Its a question for me to know, how sites like bit.ly and tinyurl.com handel this type of urls " http://site.com/xyz " ?
Are they make a folder named "xyz" and make a index file in it? If this, the count of folders gets huge! :lol:
How they handle this type of urls?

Re: Handeling http://site.com/xyz urls

Posted: Sun Aug 23, 2009 5:28 am
by jackpf
No, I'm pretty sure they use url rewrites.

Google "apache mod_rewrite" and you'll see what I mean.

:)

Re: Handeling http://site.com/xyz urls

Posted: Sun Aug 23, 2009 11:00 am
by sina_saeedi82
I install mod_rewrite and google for .htaccess but i get confused! I'm newbie. Can you tell me how can I redirect http://site.com/xyz type urls to my own urls ?

Re: Handeling http://site.com/xyz urls

Posted: Sun Aug 23, 2009 11:45 am
by jackpf

Code: Select all

RewriteRule ^xyz$ yourscript.php
Like that.

Re: Handeling http://site.com/xyz urls

Posted: Sun Aug 23, 2009 2:53 pm
by JAB Creations
Download WordPress and look at the .htaccess included.

Re: Handeling http://site.com/xyz urls

Posted: Sun Aug 23, 2009 3:32 pm
by deejay
i found this tutorial on short urls when I need to set one up

http://www.ultramegatech.com/blog/2009/ ... url-clone/

Re: Handeling http://site.com/xyz urls

Posted: Sun Aug 23, 2009 8:34 pm
by sina_saeedi82
Thank you all :)