Submitted by mario on Sat, 02/04/2011 - 02:07
I wanted to add custom apache config to one of my Aegir managed sites recently.
The Aegir handbook has a tip on injecting into site vhosts. It's pretty straightforward to extend this to work for specific sites:
<?php
function mario_provision_apache_vhost_config($uri, $data) {
if ($uri == 'mario.net.au') {
return array(
"RewriteCond %{HTTP_HOST} mario\.net\.au$ [NC]",
"RewriteRule ^/f(.*)$ /sites/mario.net.au/files/f$1 [L]"
);
}
}
?>Now you've got site specific custom apache conf that Aegir won't blow away every time you do something!
And more?
Hello
Blog
Video
Travel
Comments
Missing "}"
Thanks for this, came in handy. But I did notice its missing a closing bracket.
Right you are.
Fixed!
Add new comment