I hope you changed that to the ([a-z_]+) that I gave in my last code. It makes a difference as the - was replaced with _ so the final redirection (from date to blog) will work.
Yes, put my code BEFORE the CMS’s code so it gets the blog/yadda_yadda as the {REQUEST_URI} string. Please note that the R=301 will force the blog/yadda_yadda to be displayed, too (is it being displayed?).
Of course, the code will not work if your links are not limited to lowercase letters and -'s (or _'s). I only used those sets of characters because that’s what you gave in your first post.
Is your CMS expecting blog/yadda-yadda? If it’s a blank page (check for lack of output by viewing the source), it’s likely an error in the PHP code - or failure to find the record in the database.
RewriteEngine on
RewriteRule ^(.*)-(.*)$ $1_$2 [N]
RewriteRule ^\\d{4}/\\d{2}/\\d{2}/([a-z0-9_]+)/ [COLOR="Red"]index.php/[/COLOR]blog/$1 [R=301,L]
That’s a big faux pas! WHY would you put a file within the path part of a URI? It’s possible but you would then have to enable MultiViews and that’s a major problem.
I’m sure that your CMS installed some mod_rewrite code in your .htaccess file - just leave that AFTER the code shown above.
the cms is expressionengine and for some reason they always have the index.php at the end of the domain. it’s a default. there is a way to get rid of it though with an extension, I might do that anyway, as it doesnt look very pretty with the index.php