Can't use remote images in development

Hi,

I use the following .htaccess file in wp-content/uploads folder. With MAMPP and another servers works. In Local, not.

RewriteEngine On

RewriteBase /wp-content/uploads/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) http://customdomain.com/wp-content/uploads/$1 [L,P]

I get and Internal server error. Why?

My config.

image

+1, I’m having the same issue

@deryck,

Sorry for missing this thread!


@fr.olivier @deryck,

Have you checked the site’s Apache logs in the site’s logs folder? That should give a little more insight into what’s going on.

In case anyone is still looking for a solution to this, I tried a few options and the following htaccess format was the one that worked with Local by Flywheel.

Haven’t tested with a site that uses “Organize my uploads into month- and year-based folders”.

# Remote uploads folder
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/.*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ https://www.example.com/$1 [QSA,L]

# 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

Sorry for the delay. I was able to solve this using .htaccess in public/app

Thanks all!