SeekingCharlie
SeekingCharlie

Reputation: 607

Bitnami/Wordpress Multisite Subdirectory: Redirect Loop

I'm using the AWS/Bitnami/Wordpress stack to install WP multisite (3.5.1-1) with a subdirectory structure.

I can create sub-sites, however trying to view a sub-sites dashboard results in a 'redirect loop'. Additionally, when I view a sub-site it appears that the theme/plugins are broken.

I have installed multisites before with no issues, so am assuming that this is something related to Bitnami itself. I've searched through the database to confirm that all site URLs are the same as I read that that was a common solution, however I'm still facing the same problem.

Here is what's in my .htaccess:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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]
</IfModule>
# END WordPress

Upvotes: 3

Views: 1972

Answers (1)

Cory
Cory

Reputation: 5825

Try this:

delete your .htaccess file.

Then edit /opt/bitnami/apps/wordpress/conf/wordpress.conf and replace all content with this:

<IfVersion < 2.3 >
  NameVirtualHost *:80
</IfVersion>

<VirtualHost *:80>
 ServerAdmin [email protected]
 DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"

 <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>


  # BEGIN WordPress
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]

  # uploaded files
  RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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).*) $1 [L]
  RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
  RewriteRule . index.php [L]
  # END WordPress

 </Directory>
</VirtualHost>

Then restart apache using this command:

sudo /opt/bitnami/ctlscript.sh restart

Upvotes: 2

Related Questions