Main blog on multisite doesn't work without www

Hi there, I have a multisite sub domain install. For about as long as I can remember my main blog will not work without putting www infront of the url. i.e. http://www.skizzar.com works, http://skizzar.com doesn't.

I'm wondering if you can help me trouble shoot this.

  • Samuel

    Hey @Jude,
    htaccess looks as follows:

    <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "*"
    </IfModule>
    
    ## Enable Gzip ##
    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
    ## enable Gzip##
    
    ## SPECIFY VARY HEADER ##
    <IfModule mod_headers.c>
      <FilesMatch "\.(js|css|xml|gz)$">
        Header append Vary: Accept-Encoding
      </FilesMatch>
    </IfModule>
    ## SPECIFY VARY HEADER ##
    
    <IfModule mod_rewrite.c>
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [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]
    
    </IfModule>

    And support access has been granted.
    Thanks
    Sam

  • Michael Bissett

    Hey @Samuel, Michael here!

    Could you try using this instead:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^([a-z0-9]+).skizzar.com$ [NC]
    RewriteCond %{HTTP_HOST} !^www.skizzar.com$ [NC]
    RewriteRule ^(.*)$ http://www.skizzar.com/$1 [R=301,L]

    So that your .htaccess looks like this:

    <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "*"
    </IfModule>
    
    ## Enable Gzip ##
    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
    ## enable Gzip##
    
    ## SPECIFY VARY HEADER ##
    <IfModule mod_headers.c>
      <FilesMatch "\.(js|css|xml|gz)$">
        Header append Vary: Accept-Encoding
      </FilesMatch>
    </IfModule>
    ## SPECIFY VARY HEADER ##
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^([a-z0-9]+).skizzar.com$ [NC]
    RewriteCond %{HTTP_HOST} !^www.skizzar.com$ [NC]
    RewriteRule ^(.*)$ http://www.skizzar.com/$1 [R=301,L]
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [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]
    
    </IfModule>

    And seeing if that helps please?

    On this:

    Also, not sure if this helps the investigation, but when I clone a site using cloner, the url of the new site defaults to http://CLONEDSITE.www.skizzar.com

    Which obviously doesn't work, so I have to go and manually take out the www.

    Is this with the prior .htaccess code, or is this by default?

    Please advise,
    Michael

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.