Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
  • Apache HTTP Server 2.2.22
  • Arch Linux i686

I am using the HTML5 Boilerplate .htaccess with WordPress Multisite, which requires two .htaccess files. I’m not sure which would take precedence, so I included the entire H5BP code in each, up until the WP-specific stuff, noted here:

Under /:

# BEGIN WordPress
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).*) wordpress/$1 [L]
RewriteRule ^(.*\.php)$ wordpress/$1 [L]
RewriteRule . index.php [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
# END WordPress

Under /wordpress/:

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

All of the WordPress code seems to be in working order; my site is functional. However, the Boilerplate code does not. I’ve had no luck with e.g. mod_headers or mod_deflate taking effect, even though they are being loaded in httpd.conf, and my VirtualHost has AllowOverride All set.

For example:

<IfModule mod_headers.c>
  Header set X-UA-Compatible "IE=edge,chrome=1"
  # `mod_headers` can't match based on the content-type, however, we only
  # want to send this header for HTML pages and not for the other resources
  <FilesMatch "\.(appcache|crx|css|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svg|svgz|ttf|vcf|webapp|webm|webp|woff|xml|xpi)$">
      Header unset X-UA-Compatible
  </FilesMatch>
</IfModule>

…will not set the X-UA-Compatible header. However, if I do it directly in PHP, with <?php header('X-UA-Compatible: IE=edge,chrome=1'); ?>, then it does appear in the response.

Similarly, the following does not GZIP anything:

<IfModule mod_deflate.c>

    # Force compression for mangled headers.
    # http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping
    <IfModule mod_setenvif.c>
        <IfModule mod_headers.c>
            SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
            RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
        </IfModule>
    </IfModule>

    # Compress all output labeled with one of the following MIME-types
    # (for Apache versions below 2.3.7, you don't need to enable `mod_filter`
    #  and can remove the `<IfModule mod_filter.c>` and `</IfModule>` lines
    #  as `AddOutputFilterByType` is still in the core directives).
    <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE application/atom+xml \
                                      application/javascript \
                                      application/json \
                                      application/rss+xml \
                                      application/vnd.ms-fontobject \
                                      application/x-font-ttf \
                                      application/x-web-app-manifest+json \
                                      application/xhtml+xml \
                                      application/xml \
                                      font/opentype \
                                      image/svg+xml \
                                      image/x-icon \
                                      text/css \
                                      text/html \
                                      text/plain \
                                      text/x-component \
                                      text/xml
    </IfModule>

</IfModule>

How can I troubleshoot this?

share|improve this question
1  
Are all necessary mods (mod_rewrite, mod_headers, mod_deflate, mod_setenvif, mod_filter) installed on your machine? –  Honoki Jun 16 at 7:58
    
Is there anything in your apache error logs? –  Jenny D Jun 16 at 8:04

1 Answer 1

Hopefully you resolved it by now. I just wanted to point out that this helped me resolve my issue.

# Compress all output labeled with one of the following MIME-types
# (for Apache versions below 2.3.7, you don't need to enable `mod_filter`
#  and can remove the `<IfModule mod_filter.c>` and `</IfModule>` lines
#  as `AddOutputFilterByType` is still in the core directives).

The above snip you posted while searching for answers clued me in. Was mod_filter enabled? I checked and nope it wasn't which would stop this in its tracks.

Like Honoki said make sure (mod_rewrite, mod_headers, mod_deflate, mod_setenvif, mod_filter) are installed and/or enabled for Boilerplates's mod_deflate section to work.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.