2 Responses to “Redirect directory and contents using htaccess”

Comments

Read below or add a comment...

  1. trau

    hi! very congratulation for this blog! very interesting! :)
    i have a question about this post..

    I would use your code for redirect my images into my WP blog from folder wp-contet/uploads to bucket in s3 of amazon and so another domain with same sub folder (importa same sub folder)

    example:
    FROM:
    http://my-site.it/wp-content/uploads/2010/09/aaa.jpg

    TO:
    http://my-bucket.s3.amazonaws.com/2010/09/aaa.jpg

    this is my htaccess:

    RewriteEngine On
    RewriteRule ^/wp-content/uploads/(.*)$ http://MY-BUCKET.s3.amazonaws.com/$1 [L]

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

    But redirect image to s3 dont work :( (
    PS pubblic url of image in s3 is good in a new browser :)

    where i wrong?
    sorry my bad english :)

    can you help me with rule in htaccess please?? :) )
    thank you
    erwin

Leave A Comment...