wordpress wp-content/uploads folder 301 redirect to S3 bucket by cloudfrond CDN by .htaccess issues

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


wordpress wp-content/uploads folder 301 redirect to S3 bucket by cloudfrond CDN by .htaccess issues



See below, the .htacess file from wordpress. If I remove the part starting from #begin Wordpress. All the image file url will be change to d28rt1vkpsdxas.cloudfront.net/someimage.png successfully.



However, all the internal link will be unable to access(only the home page can access). The error is



Not Found The requested URL /shop/ was not found on this server.



But if I keep the part start from #begin Wordpress. The cdn redirect will not work any more. All photos are missing.



Thanks in advanced.


Options +FollowSymlinks

RewriteEngine on

Rewriterule ^wp-content/uploads/(.*)$ http://exampled28t1vkps.cloudfront.net/$1 [r=301,nc]

# 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









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Visual Studio Code: How to configure includePath for better IntelliSense results

Spring cloud config client Could not locate PropertySource

Makefile test if variable is not empty