CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Apache configuration (http://www.codingforums.com/forumdisplay.php?f=69)
-   -   Conditional Rewrite not Working (http://www.codingforums.com/showthread.php?t=253138)

Erve 03-02-2012 12:45 PM

Conditional Rewrite not Working
 
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!!!

Erve 03-04-2012 12:09 PM

Does no-one have any ideas?


All times are GMT +1. The time now is 12:50 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.