• Resolved justindevelops

    (@justindevelops)


    Hello all.. I am trying to utilize a CDN for my /wp-content/uploads folder on AWS and this folder is being re-directed to the CDN. However when I have that turned on I cannot have permalinks turned on which is preventing me from using any caching or minify program. I can have either on alone and it works, but with both no go. Below is my current .htaccess file. Anyone have any ideas I can try?

    #Options +FollowSymLinks
    RewriteEngine On
    rewriterule ^wp-content/uploads/(.*)$ https://MyCloudFrontName.cloudfront.net/$1 [$
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
Viewing 1 replies (of 1 total)
  • Thread Starter justindevelops

    (@justindevelops)

    and as usual when I ask for help I figure it out while waiting. ??

    For those who might come across this as well here is my fix hope it helps you. It came down to ordering and not having the engine turned on twice.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    RewriteRule ^wp-content/uploads/(.*)$ https://MyCloudFrontName.cloudfront.net/$1 $
    </IfModule>
    
    # END WordPress
Viewing 1 replies (of 1 total)
  • The topic ‘Permalinks & wp-content/Uploads on CDN .htaccess issues.’ is closed to new replies.