Skip to content

Instantly share code, notes, and snippets.

View jacobmc's full-sized avatar

Jacob McKinney jacobmc

View GitHub Profile
@jacobmc
jacobmc / .htaccess
Created October 22, 2021 18:46
Rewrites file paths to come from production if they don't exist locally. Add to top of .htaccess
# BEGIN Dev Image
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^example.localhost$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^\/app\/uploads\/(?!beaverbuilder)[^\/]*\/.*$
RewriteRule ^(.*)$ https://www.example.com/$1 [QSA,L]
</IfModule>
@jacobmc
jacobmc / .htaccess
Created February 25, 2022 20:16
Proxy for Production Images on Localhost
# BEGIN Dev Image
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^example.localhost$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^\/app\/uploads\/(?!beaverbuilder)[^\/]*\/.*$
RewriteRule ^(.*)$ https://www.example.com/$1 [QSA,L]
</IfModule>