I feel my Rewriterules are a bit redundant. Is there a way to shorten the following htaccess code,into one line please? I'm thinking it would use an * somewhere, but I just can't figure it out xD
RewriteRule ^([^/\.]+)?$ index.php?year=$1 [L]
RewriteRule ^([^/\.]+)/?$ index.php?year=$1 [L]
RewriteRule ^([^/\.]+)/([^/\.]+)?$ index.php?year=$1&month=$2[L]
RewriteRule ^([^/\.]+)/([^/\.]+)/?$ index.php?year=$1&month=$2[L]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)?$ index.php?year=$1&month=$2&day=$3[L]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?year=$1&month=$2&day=$3[L]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)?$ index.php?year=$1&month=$2&day=$3&post=$4[L]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?year=$1&month=$2&day=$3&post=$4[L]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)?$ index.php?year=$1&month=$2&day=$3&post=$4&action=$5 [L]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?year=$1&month=$2&day=$3&post=$4&action=$5 [L]
Thank you!
Currently, a php script checks if each GET parameter is set, and depending on which parameter is available, it does a different task. My PHP code works perfectly, no problem, but I am only wondering if there is a way to shorten the apache rules above. I also realize that this way of parsing GET parameters may create many many loopholes, so I appreciate any advice or feedback! :) Thanks a lot ^_^