• Hi there,

    I looked everywhere on this forum but I couldn’t find a solution.
    I am trying to use cloudfront with WP Super Cache but the rewrite is not working. That mean that my images are still loading from wp-content/uploads/… instead of mydistribution.cloudfront.net/wp-content/uploads/…

    Here is my configuration: https://prntscr.com/9owrxj
    My website is running on https. all http requests are redirected to https!

    The content of htaccess is as following:

    # Remove ETags
    FileETag none
    
    # BEGIN Far Future Expiration
    <IfModule mod_expires.c>
    # Enable expirations
    ExpiresActive On
    # Default directive
    ExpiresDefault "access plus 1 hour"
    # My favicon
    ExpiresByType image/x-icon "access plus 1 hour"
    # Images
    ExpiresByType image/gif "access plus 1 hour"
    ExpiresByType image/png "access plus 1 hour"
    ExpiresByType image/jpg "access plus 1 hour"
    ExpiresByType image/jpeg "access plus 1 hour"
    # CSS
    ExpiresByType text/css "access plus 1 hour"
    # Javascript
    ExpiresByType application/javascript "access plus 1 hour"
    </IfModule>
    # END Far Future Expiration Plugin
    
    <IfModule mod_rewrite.c>
    RewriteCond %{HTTP_HOST} !^(.*)\.zigma\.ma$ [NC]
    RewriteRule ^(.*)$ https://www.zigma.ma/$1 [R=301,L]
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.zigma.ma/$1 [R,L]
    </IfModule>
    
    # WordPress SEO - XML Sitemap Rewrite Fix
    RewriteEngine On
    RewriteBase /
    RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
    RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
    RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
    RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
    RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
    # END WordPress SEO - XML Sitemap Rewrite Fix
    
    # 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
    
    # 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

    Thank you very much

    https://www.ads-software.com/plugins/wp-super-cache/

Viewing 4 replies - 1 through 4 (of 4 total)
  • David

    (@divorcetheworld)

    Ever figure this out?

    Same problem here. My configuration an htaccess look somewhat similar.

    I just started testing a CDN and I only see the .jpg files redirected to it, all css and js still served from my site.

    Using latest version 1.4.8.

    I have used this plugin in the past, and tried it again after abandoning it for a couple of years. WP Super Cache is lightweight and easy to configure, but it does not work with HTTPS on Amazon Cloudfront. I have spent hours trying to make it work with no success. Using W3 Total Cache the setup for AWS is easy. Simply enter your credentials, and W3 Total Cache atomically connects to AWS and creates the distribution and starts working. WP Super Cache uses a different approach. You have to create your CDN distribution yourself, and then enter your AWS Cloudfront address and it does not work. It is a pity but I have had to go back to W3 Total Cache.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WP Super Cache not rewriting CDN url’ is closed to new replies.