Created
July 18, 2016 17:40
-
-
Save PascalAnimateur/edf2c4caa60f9f697d81a2dfda8b3c3b to your computer and use it in GitHub Desktop.
Redirect all public files to sites/$uri/files in Aegir 3.x
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 characters
<?php | |
function site_redirect_provision_apache_vhost_config($uri, $data) { | |
$rval[] = ''; | |
$rval[] = '# Redirect all files public path to sites/$uri/files'; | |
$rval[] = 'RewriteEngine On'; | |
$rval[] = "RewriteCond %{REQUEST_URI} !^/sites/$uri/files"; | |
$rval[] = "RewriteRule ^/sites/[^\/]*/files/(.*)$ /sites/$uri/files/$1 [R=301,L]"; | |
$rval[] = ''; | |
return $rval; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment