Skip to content

Instantly share code, notes, and snippets.

@CarlosLongarela
Forked from fgrweb/uploads_produccion.txt
Created July 19, 2022 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CarlosLongarela/41f6d0e74e37d0c7647ab5117c811822 to your computer and use it in GitHub Desktop.
Save CarlosLongarela/41f6d0e74e37d0c7647ab5117c811822 to your computer and use it in GitHub Desktop.
Código en .htaccess para que lea los archivos de medios del sitio en producción
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/.*$
RewriteRule ^(.*)$ https://sitioproduccion.com/$1 [QSA,L]
# Para entornos NGINX me ha funcionado poner lo siguiente en la configuración
location ~* ^.+\.(svg|svgz|jpg|jpeg|gif|png|ico|bmp|pdf)$ {
try_files $uri @image_fallback;
}
location @image_fallback {
proxy_pass http://sitioproduccion.com;
}
@CarlosLongarela
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment