• Hi All,
    Im having this issue with adding www to a domain name via htaccess since i forgot to do that on single install, now this simple rule causes infinite loop. Here is the htacces (i changed my domain into mysite.com):

    # 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
    
    #RewriteEngine On
    #redirecting wwwto non-www
    #RewriteBase /
    #RewriteCond %{HTTP_HOST} ^www.mysite.com [NC]
    #RewriteRule ^(.*)$ http://mysite.com/$1 [L,R=301] 
    
    # Redirect non-www urls to www
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www\.mysite\.com
    RewriteRule (.*) http://www.mysite.com/$1 [R=301,L] 
    
    #WPMUsetup
    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]
    
    # compress text, html, javascript, css, xml:
    AddOutputFilterByType DEFLATE
    
     text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    
    # Or, compress certain file types by extension:
    <files *.html>
    SetOutputFilter DEFLATE
    </files>
Viewing 1 replies (of 1 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Firs of all, strip your .htaccess down to JUST WordPress’s core commands. Always do this for a test 🙂 Does the site work? Can www go where it needs? I know, we’re doing this WITHOUT the force redirect on. Trust me here. If THAT doesn’t work, it’s not the .htaccess.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding www over .htaccess couses inifinite loop in wpmu’ is closed to new replies.