Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2011
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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!!!

  • #2
    New Coder
    Join Date
    Oct 2011
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Does no-one have any ideas?


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •