Skip to content

Instantly share code, notes, and snippets.

@robdimarco
Last active November 6, 2016 11:57
Show Gist options
  • Select an option

  • Save robdimarco/7104034 to your computer and use it in GitHub Desktop.

Select an option

Save robdimarco/7104034 to your computer and use it in GitHub Desktop.
Changes to Bitnami Wordpress Multi-Site to work with sub directories.
<Directory "/opt/bitnami/apps/wordpress/htdocs">
Options +MultiViews +FollowSymLinks
AllowOverride None
<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.3>
Require all granted
</IfVersion>
</Directory>
<Directory "/opt/bitnami/apps/wordpress/htdocs/content">
RewriteEngine On
RewriteBase /content/
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
# Standard Multi-site Hack
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Standard Multi-site Hack
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
# Standard Multi-site Hack
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
</Directory>
DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"
#Alias /wordpress/ "/opt/bitnami/apps/wordpress/htdocs/"
#Alias /wordpress "/opt/bitnami/apps/wordpress/htdocs"
<IfDefine USE_PHP_FPM>
ProxyPassMatch ^/content/(?!wp-)[a-z_\-A-Z0-9]+/(.*\.php(/.*)?)$ fcgi://uds=%2fopt%2fbitnami%2fphp%2fvar%2frun%2fwordpress.sock/opt/bitnami/apps/wordpress/htdocs/content/$1
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://uds=%2fopt%2fbitnami%2fphp%2fvar%2frun%2fwordpress.sock/opt/bitnami/apps/wordpress/htdocs/$1
</IfDefine>
Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf"
mkdir apps/wordpress/htdocs/content
mv apps/wordpress/htdocs/*.* apps/wordpress/htdocs/content
mv apps/wordpress/htdocs/wp* apps/wordpress/htdocs/content
echo "update wp_options set option_value = 'http://stage.elocal.com/content' where option_id in (1,36); update wp_blogs set domain = 'stage.elocal.com', path = '/content/';" | mysql -uroot -pbitnami bitnami_wordpress
sudo ~/stack/ctlscript.sh restart apache php-fpm
/* Modifications */
define( 'DOMAIN_CURRENT_SITE', 'stage.elocal.com' );
define( 'PATH_CURRENT_SITE', '/content/' );
define( 'SUBDOMAIN_INSTALL', false );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment