I don't think those sites use mod_rewrite because an URl can be anything,
including:

http://www.oijoij.com/eorier/eoroeir/oier/eorij.pl?terer=wer4334&oijo=weroo&jjjjj=123#

(or much more complicated urls).

Those sites (because there are more) just put the urls in a database, and
assign an ID to each one.

Then, a program (that can be made in any language) queries the database for
the given ID, and get the long URL. Then it redirects to that URL and that's
all.

I have made such a program in perl but it is very very simple.

Teddy

----- Original Message ----- 
From: "Ramil Sagum" <[EMAIL PROTECTED]>
To: "Henri Marc" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, September 18, 2004 2:29 PM
Subject: Re: [PHP] How does work shorten url services?


On Sat, 18 Sep 2004 10:49:34 +0200 (CEST), Henri Marc
<[EMAIL PROTECTED]> wrote:
> Hello,
>
> The principle is that you enter your long url in their
> form and it gives you a shorten url like
> tinyurl.com/h4599
>
> I was wondering how it works. I think it must use PHP.
>

It would use a feature of an HTTP server such as Apache -- URL rewriting

Basically, you can make rules such that urls like

http://tinyurl.com/h4599


become


http://tinyurl.com/index.php?id=h4599


you would then handle it from there.

But this is off topic :)
----


ramil

http://ramil.sagum.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to