I've been fighting with this for two days, and it's driving me nuts. My customer has a site built on a blog platform. His registrar allows .htaccess edits, but the site itself is hosted with a different company.
This is what I've added to the .htaccess file:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301]
RewriteRule ^/([^/]+)$ /2010/02/$1
The first rule is just a basic canonical URL forward. The second rewrite is supposed to rewrite a simple page URL (i.e. http://www.example.com/page.html) so it pulls the "static" blog pages the customer created last February (i.e. http://www.example.com/2010/02/page.html). I need it to ignore any pages in subdirectories (i.e. http://www.example.com/2011/07/newpage.html) because the rest of the pages are actual blog posts.
The first rule works great. The second does absolutely nothing. What am I doing wrong?
Thanks in advance for the help!