I have the following .htaccess file for my website which is hosted on a Linux, Apache and PHP 5.4.41 stack:
# 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
The following PHP 5.4.41 functionality is available to me on this server as shown here in the PHP info file:
http://88.208.252.229/phpinfo.php
I'm trying to optimise the website so that output from the server is compressed before being sent to the client over the network.
Now I believe this achieved with mod_deflate
- The problem is that I don't know how to implement this in the .htaccess file.
In it's most simple form could I not enable compression for HTML files by making my overall .htaccess file look like this? I'm assuming the "/your-server-root/manual"
would most likely be htdocs.
# 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
<Directory "/your-server-root/manual">
AddOutputFilterByType DEFLATE text/html
</Directory>
The final thing to mention that my server would be pre-processing a wide range of files and delivering them to the client such as .jpeg, .html etc. So I would want the mod_deflate
to compress as much as reasonably possible.
If anyone can take the time to answer this and increase my understanding of the issue it would be very much appreciated. Thanks in advance.