nativeInstallerwordpress-multisite

Configure WordPress Multisite to use subdirectories instead of subdomains

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and Mac OS X) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). Learn more.

NOTE: These steps should be performed before creating a new site.

Follow the steps below:

  • Edit the installdir/apps/wordpress/htdocs/wp-config.php and modify the definition as shown below:

    define('SUBDOMAIN_INSTALL', false);
    
  • Edit the installdir/apps/wordpress/conf/httpd-app.conf file and replace the existing URL rewriting rules so that they look like this:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
  • Restart Apache to apply the changes:

    $ sudo installdir/ctlscript.sh restart apache
    
Last modification September 4, 2018