I have mod_rewrite take this url:
mydomain.com/directory/index.php?slug=slug&year=2009
and make it pretty:
mydomain.com/directory/slug/2009/
Easy, but now my issue is, if someone lands at the URL without the year attached (like: mydomain.com/directory/slug/), how can I add the current year to the URL?
My current htaccess
reads:
RewriteEngine on
RewriteRule ^([^/\.]+)/([^/\.]+)?$ /directory/$1/$2/ [R]
RewriteRule ^([^/\.]+)/([^/\.]+)/?$ /directory/index.php?slug=$1&year=$2 [L]