• Hi,

    I’m running a brand new Bitnami WP Multisite instance on Google Cloud Platform with five websites configured on it. I’m also running most of the Bitnami provided modules, like WordPress MU Domain Mapping. Each website is configured to use a separate domain name. All plug-ins are up to date.

    All of this was running fine, until one day (most) pages started returning 404 errors. Here’s a sample page: https://www.gelvoc.be/start-to-volley/. I’m not sure what triggered these 404’s, but I think they started appearing after altering some theme settings.

    The 404’s happen with both current and new pages that are created. The 404’s only occur on pages, not posts eg. https://www.gelvoc.be/2017/04/23/wedstrijden-18-22-en-23-april-2017/.

    The only ‘solution’ is to disable pretty permalinks.

    Obne strange thing is that in one of the five websites, the pretty permalinks work as they should. I can’t figure out any difference in configuration with the other websites.

    I also posted this problem on the Bitnami community forum, but alas, no real answer but to migrate everything … which I did, but the problem repeated itself. Here’s the link to that post: https://community.bitnami.com/t/pretty-permalinks-404-errors-with-pages-on-wp-multisite/49819

    Any help is much appreciated.

    • This topic was modified 7 years, 5 months ago by mamebart.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Ben

    (@benbornschein)

    Please go to Settings > Permalinks and press “Save Changes”.

    Can you check if your .htaccess contains this:

    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)$ wp/$1 [L]
    RewriteRule . index.php [L]
    
    • This reply was modified 7 years, 5 months ago by Ben. Reason: Updated .htaccess code
    • This reply was modified 7 years, 5 months ago by Ben.
    Ben

    (@benbornschein)

    Obne strange thing is that in one of the five websites, the pretty permalinks work as they should. I can’t figure out any difference in configuration with the other websites.

    Which of your five websites work? Is the working website the first website that is working?

    Thread Starter mamebart

    (@mamebart)

    I’ve added the code to htaccess.conf (that’s how Bitnami works), see below. Restarted apache but the 404’s are still there. I know I should change the permalink and try to save multiple times.

    The website that is working correctly is number 3, so not the primary domain.

    <Directory "/opt/bitnami/apps/wordpress/htdocs">
    	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)$ wp/$1 [L]
    	RewriteRule . index.php [L]
    </Directory>
    	
    <Directory "/opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/akismet">
    # Only allow direct access to specific Web-available files.
    
    # Apache 2.2
    <IfModule !mod_authz_core.c>
    	Order Deny,Allow
    	Deny from all
    </IfModule>
    
    # Apache 2.4
    <IfModule mod_authz_core.c>
    	Require all denied
    </IfModule>
    
    # Akismet CSS and JS
    <FilesMatch "^(form\.js|akismet\.js|akismet\.css)$">
    	<IfModule !mod_authz_core.c>
    		Allow from all
    	</IfModule>
    	
    	<IfModule mod_authz_core.c>
    		Require all granted
    	</IfModule>
    </FilesMatch>
    
    # Akismet images
    <FilesMatch "^logo-full-2x\.png$">
    	<IfModule !mod_authz_core.c>
    		Allow from all
    	</IfModule>
    	
    	<IfModule mod_authz_core.c>
    		Require all granted
    	</IfModule>
    </FilesMatch>
    </Directory>
    <Directory "/opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/versionpress">
    # Apache 2.2
    <IfModule !mod_authz_core.c>
        Order Deny,Allow
        Deny from all
    </IfModule>
    
    # Apache 2.4
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    
    </Directory>
    <Directory "/opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/versionpress/admin/public">
    # Apache 2.2
    <IfModule !mod_authz_core.c>
        Allow from all
    </IfModule>
    
    # Apache 2.4
    <IfModule mod_authz_core.c>
        Require all granted
    </IfModule>
    
    </Directory>
    
    Thread Starter mamebart

    (@mamebart)

    Actually, there is an .htaccess file, but Bitnami should ignore it. Here’s the content of that file:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    Thread Starter mamebart

    (@mamebart)

    To complicate things more, there is also a file called httpd-app that also contains a rewrite rule. Here’s the content of that 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>
    
        
       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"
    </Directory>
    
    Include "/opt/bitnami/apps/wordpress/conf/htaccess.conf"
                        
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WP Multisite: pretty permalinks returns 404 (for pages)’ is closed to new replies.