How to stop URL rewrite for archives in wordpress

I was setting up url rewrite for wordpress blog to remove all dates from the url (www.example.com/2012/08/postname). I had to do it through htaccess because it was new design for established blog, and by doing it through htaccess whill change links within the post as well (for example, if author links to another article, he used www.example.com/2012/07/postname). So simply adjusting permalinks in backend would not work.

I have used this code to create rewrites:

Read More
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(.*)$  http://www.example.com/$3
</IfModule>

Now, my archives stopped working because their url is something like www.example.com/2012/08/. Is there any way to stop rewrite rule only in case the url contains only dates(ex. www.example.com/2012/08/), but keep rewrite for all posts containing date(ex. www.example.com/2012/08/posttitle)?

Related posts

Leave a Reply