I am trying to create a semi-serverless SPA w/ a blog but want to have "RESTful" URLs. I have the following .htaccess commands doing the job--in combination with JavaScript History API; but, wondering if I can simplify it with regex or RewriteEngine. Hopefully this is just a "code golf" question but hoping to turn the following sequence of .htaccess commands into a one-liner. Is this possible without server-side code?
The regex I've tried so far is as follows:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
Redirect 301 "/blog" "/?page=blog"
RewriteRule ^blog/([0-9]{1,2})/([0-9]{1,2})/([0-9]{4})$ /?page=blog&month=$1&day=$2&year=$3 [L]
However, I keep landing at /blog instead of e.g., /blog/1/1/2010.
