• Have a question.

    I installed Total Cache. When it wrote the rules in the .htaccess file with the multisite rewrite rules in the file, it threw the site into a 500 error. I had to remove the .htaccess file, uninstall and reinstall Total Cache and now it’s working correctly. However, it’s working with only Total Cache rules in the new .htaccess file.

    # BEGIN W3TC CDN
    <FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css)$">
    <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "*"
    </IfModule>
    </FilesMatch>
    # END W3TC CDN
    # BEGIN W3TC Browser Cache
    <IfModule mod_deflate.c>
        <IfModule mod_headers.c>
            Header append Vary User-Agent env=!dont-vary
        </IfModule>
            AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
        <IfModule mod_mime.c>
            # DEFLATE by extension
            AddOutputFilter DEFLATE js css htm html xml
        </IfModule>
    </IfModule>
    # END W3TC Browser Cache
    # BEGIN W3TC Minify cache
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /
        RewriteRule ^[_0-9a-zA-Z-]+/wp-content/cache/minify/[0-9]+/w3tc_rewrite_test$ /wp-content/plugins/w3-total-cache/pub/minify.php?w3tc_rewrite_test=1 [L]
    </IfModule>
    # END W3TC Minify cache

    What about the former multisite rules under the domain mapping, network setup panel?

    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]

    Where do these go?

    Seems there was a conflict when .htaccess was being overwritten, which is why the 500 error. Now that I figured that out, do I put the multisite rules back in the htaccess file?

    https://wordpress.org/plugins/w3-total-cache/

Viewing 1 replies (of 1 total)
  • Thread Starter Tony Zeoli

    (@tonyzeoli)

    Well, maybe I answered my own question. Added those rules to the bottom of the .htaccess file and nothing bad happened, so…I guess it should be fine unless someone tells me different.

    Maybe the installation instructions on primary W3TC page need to be updated to let people know that if the .htaccess file is incorrectly overwritten, that you need to take steps to fix it?

Viewing 1 replies (of 1 total)

The topic ‘Question about .htaccess rules and multisite’ is closed to new replies.