Created
January 9, 2018 11:20
-
-
Save elalemanyo/30d5b3ec31a67e7795fb296c20585919 to your computer and use it in GitHub Desktop.
Revisions
-
elalemanyo created this gist
Jan 9, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ ### Apache Rewrite <IfModule mod_rewrite.c> RewriteEngine on # Force image styles that have local files that exist to be generated. RewriteCond %{REQUEST_URI} ^/sites/([^\/]*)/files/styles/[^\/]*/public/((.*))$ RewriteCond %{DOCUMENT_ROOT}/sites/%1/files/%2 -f RewriteRule ^(.*)$ $1 [QSA,L] # Otherwise, send anything else that's in the files directory to the # production server. RewriteCond %{REQUEST_URI} ^/sites/[^\/]*/files/.*$ RewriteCond %{REQUEST_URI} !^/sites/[^\/]*/files/css/.*$ RewriteCond %{REQUEST_URI} !^/sites/[^\/]*/files/js/.*$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ http://dev.example.com/$1 [QSA,L] </IfModule> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ ### nginx Rewrite ## Try local files first, otherwise redirect to a development server. location ^~ /sites/default/files { try_files $uri @dev_redirect; } ## Development Server Redirect location @dev_redirect { rewrite ^ http://dev.example.com$request_uri? permanent; }