CSS not rendering on multisite subfolders

I'm trying to set up a WP multisite using subfolders on a mac mini. I set everything up automatically using the bitnami multisite installer, and the main site seems to be functioning perfectly. The problem is all other sites, which are in subfolders, are rendering without any CSS.

I've done a lot of reading on this and people seem to say it's related to the .htaccess file, which I've modified according to the instructions in network setup for subfolders. I've also pasted it below:

# BEGIN WordPress
AllowOverride FileInfo Options All

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

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d

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

I've also set the the wp-config site as requested:

define( 'SUBDOMAIN_INSTALL', false );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'wordpress.standrews-de.org' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

Here is an example of one of the errors the site reports when trying to load css files:

Failed to load resource: the server responded with a status of 404 (Not Found)

http://wordpress.standrews-de.org/jburk/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1

Any help would be most appreciated.

  • Vaughan
    • Support/SLS MockingJay

    Hi @johnburk,

    I have no experience with bitnami i'm afraid. Your htaccess & wp-config.php look fine though.

    I've always found these 1 click installers to be problematic, it's just as easy though to install manually instead. If that's an option for you? then it would be much safer & future proof in my opinion to install it the manual way.

    Though I only have experience with Xampp, not bitnami itself.

    http://codex.wordpress.org/User:Beltranrubo/BitNami_Multisite

    You can find more here. http://codex.wordpress.org/Create_A_Network

    Some docs on bitnami;

    http://lostincreativity.com/blog/bitnami-multisite-wordpress-stack-installation-issues-and-fixes/

    http://community.bitnami.com/t/multisite-subdirectories-fails-to-get-created/21885

    http://ilikekillnerds.com/2014/03/tips-tricks-using-the-aws-bitnami-wordpress-ami-image/

    Hope this helps

  • johnburk
    • WPMU DEV Initiate

    Vaugn,
    I can try to install manually, but honestly, I haven't found it to be all that easy. I'm running on a mac-mini server. If you've got a link to some easy to follow directions for installing WP multi-site, I'd love to see them.

  • Jack Kitterhing
    • Code Norris

    Hiya @johnburk,

    Hope you're well today, I believe the issue here is your .htaccess.

    Your .htaccess is incorrect, it should be

    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]

    Can you try changing it to that and see if loads the resources correctly then? :slight_smile:

    We're here to help. :slight_smile:

    Thank you!

    Kind Regards
    Jack.

  • johnburk
    • WPMU DEV Initiate

    So I tried his change. First I completely reinstalled WP 3.9.2 using the bitnami package. Then I changed the .htaccess file to read:

    # BEGIN WordPress

    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]
    # END WordPress

    And then I changed the following two lines in the default wp-config file:

    define('WP_ALLOW_MULTISITE', true);
    define( 'SUBDOMAIN_INSTALL', false );

    I think logged into the blog, and created a site /jburk

    When I tried to visit wordpress.standrews-de.org/jburk, I got a page with no CSS, but it did look like the content was default blog content.

  • Jack Kitterhing
    • Code Norris

    Hi there @johnburk,

    Hope you're well today and thanks for the additional information.

    I see the multisite is installed on a subdomain and it's a sub directory based multisite, this should technically be working.

    Can you send me the following please so I can investigate what's happening here?

    - In the subject field add "Attn: Jack Kitterhing"
    - Link back to this thread
    - Include admin/network access
    - Include FTP
    - Include any relevant URLS for your site

    On the contact form, select "I have a different question", this ensures it comes through and gets assigned to me.

    https://premium.wpmudev.org/contact/

    Thank you!

    Kind Regards
    Jack.

  • Jack Kitterhing
    • Code Norris

    Hi there @johnburk,

    Hope you're well today! :slight_smile:

    I've been checking this and your .htaccess is good, there's no plugin or theme conflicts, and WP_DEBUG isn't outputting any errors or warnings.

    I've flagged one of our developers for their valuable input on this.

    Thank you!

    Kind Regards
    Jack.

  • johnburk
    • WPMU DEV Initiate

    Jack,
    Thanks for your help. I really need to get this site working, so I would appreciate any guidance you might be able to give me. Should I just reinstall it completly? Is there a guide somewhere for installing WP on a mac that doesn't involve one of these prebuilt installers?

  • Jack Kitterhing
    • Code Norris

    Hi there @johnburk,

    Hope you're well today! :slight_smile:

    We have a great guide here on using MAMP https://premium.wpmudev.org/blog/how-to-install-wordpress-and-multisite-locally-on-macos-x-with-mamp/ if that would work for you?

    That's locally only, if you want to make it live, I'd highly recommend picking up some cheap hosting, you can get hosting pretty cheaply from places like siteground and site5. :slight_smile:

    Thanks!

    Kind regards
    Jack.

  • Jose
    • Bruno Diaz

    Hey there @johnburk,

    Thanks for your patience here and sorry that I'm jumping late into the thread.

    The issue here is quite simple.

    .htaccess files are not honored in a Bitnami installation :disappointed:

    You can easily confirm this by removing your .htaccess file; the site will behave the same with or without the file.

    This is a "security measure" from bitnami.

    Instead of using the .htaccess file, you need to add the rules to the following file:
    apps/wordpress/conf/http-app.conf

    You would want to make a buckup before.

    After saving and pushing the modified file, you will need to restart Apache so that the changes can take effect.

    btw, the correct rules are the ones posted by jack above.

    Please let me know if it works as expected now. :slight_smile:

    Cheers,
    Jose

    • Faraz
      • New Recruit

      Jose,

      I''m having similar issues with my bitnami wp multisite deployment. I'm hosting on subdomains, the main domain is evtech.io and the subdomain is enlight.evtech.io

      CSS does not seem to be rendering, and I noticed on enlight.evtech.io, it may even be issues with the php, as chrome devtools show that the CSS file is recognized (inspect element, click "source", and the stylesheets are recognized on each element).

      I've followed all the steps outlined above. I added the code for .htaccess shown on the Network Setup page in Wordpress to the httpd-app.conf file. I didn't replace the Rewrite rules that were already in the httpd-app.conf file, I simply added the .htaccess rules below them. Restarted Apache, rebooted the server, and no results.

      Here is the code in my httpd-app.conf file:

      <IfDefine USE_PHP_FPM>
          <Proxy "unix:/opt/bitnami/php/var/run/wordpress.sock|fcgi://wordpress-fpm" timeout=300>
          </Proxy>
      </IfDefine>
      
      <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>
      
          <IfDefine USE_PHP_FPM>
             <FilesMatch \.php$>
               SetHandler "proxy:fcgi://wordpress-fpm"
             </FilesMatch>
          </IfDefine>
      
          //*RULES THAT WERE ALREADY IN THE FILE*//
         RewriteEngine On
         RewriteBase /
         RewriteRule ^index\.php$ - [S=2]
      
         # uploaded files
         RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
      
         RewriteCond %{REQUEST_FILENAME} !-f
         RewriteCond %{REQUEST_FILENAME} !-d
         RewriteRule . index.php [L]
      
          Include "/opt/bitnami/apps/wordpress/conf/banner.conf"
      
      //*RULES I COPIED FROM THE .HTACCESS FILE*//
              RewriteEngine On
      RewriteBase /
      RewriteRule ^index\.php$ - [L]
      
      # add a trailing slash to /wp-admin
      RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
      
      RewriteCond %{REQUEST_FILENAME} -f [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^ - [L]
      RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
      RewriteRule ^(.*\.php)$ $1 [L]
      RewriteRule . index.php [L]
      </Directory>
      
      Include "/opt/bitnami/apps/wordpress/conf/htaccess.conf"

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.