3 ms·
input.php - input box asking for url. call create.php on form submit. create.php - generates random string, adds url and random string to urls table redirect.
by zaidf 18y ago
input.php - input box asking for url. call create.php on form submit.
create.php - generates random string, adds url and random string to urls table
redirect.php - takes random string. finds url associated with it. redirects
.htaccess - catches http//domain.com/<random string> and maps it to redirect.php
- callmeed 18y agoand make sure to redirect with a 301
- zacharydanger 18y agoi.e. header($final_destination, true, 301)
- zacharydanger 18y agoWow, I really botched that up. header("Location: " . $final_destination, true, 301) In my defense, I generally wrap this call into my own redirect function.