bfkouba — 2011-08-10T23:42:33-04:00 — #1
I'm developing a quote of the day website and using this in my index.php to redirect the user to a url specific to the current day:
<?php header('Location: /'.date("z")); ?>
That points the browser to a URL like this:
http://domain.com/221 (where 221 is the day of the year)
But I obviously don't want to create 365 different folders for all of these days... so how do I do it?
Can I create a file like http://domain.com/quote.php?day=221 that masks to http://domain.com/221
Help!... and THANKS for your help.
dan_grossman — 2011-08-11T02:02:20-04:00 — #2
RewriteRule ^/?([0-9]+)$ quote.php?day=$1 [L]
bfkouba — 2011-08-11T09:03:59-04:00 — #3
Thanks, Dan! That is absolutely spot on.