deryck
February 7, 2018, 10:25pm
1
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.
+1, I’m having the same issue
clay
March 30, 2018, 4:03pm
3
@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
deryck
January 7, 2020, 12:26pm
5
Sorry for the delay. I was able to solve this using .htaccess in public/app
.htaccess
#Put this file in wp-content/uploads and modify remote domain.
#Copia este arhivo en wp-content/uploads and modifica el dominio remoto.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp-content/uploads/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) http://remotedomain.tld/wp-content/uploads/$1 [L,P]
</IfModule>
Thanks all!