I'm struggling to get my conditional rewrite working....
Basically, I'm trying to rewrite old WP permalinks, but exclude the uploads folder from the rewrite.
So
http://www.mydomain.com/2011/02/mypost/ becomes
http://www.mydomain.com/mypost/.
BUT
http://www.mydomain.com/wp-content/uploads/2011/02/mypicture.jpg does not change.
The code I have so far is:
Code:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/robots\.txt$ [NC]
RewriteCond %{HTTP_HOST} !^www\.[a-z-]+\.[a-z]{2,6} [NC]
RewriteCond %{HTTP_HOST} ([a-z-]+\.[a-z]{2,6})$ [NC]
RewriteRule ^/(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !^/wp-content/uploads
RewriteRule /([0-9]+)/([0-9]+)/(.*)$ http://www.mydomain.com/$3
But it's not working.... Would be really grateful if someone can tell me where I'm going wrong!!!