CompressX Documentation

Everything you need to install, configure, and get the best performance from CompressX Free and Pro.

CompressX Docs
Document Notice

Help Improve the Documentation

If you notice something unclear, outdated, or incorrect, feel free to let us know.

Your feedback helps keep the documentation accurate and useful for everyone.

Config Apache .htaccess

Jan 7, 2026 | Docs

CompressX works seamlessly with most Apache servers. In some environments, Apache must be configured correctly to allow .htaccess rewrite rules to function. If you encounter rewrite rules errors or issues serving optimized WebP/AVIF images, follow the steps below to ensure CompressX operates properly on your server.

Why This Matters

CompressX uses rewrite rules in Apache’s .htaccess to serve optimized WebP and AVIF images automatically. If Apache is not configured to allow .htaccess overrides, these rules will not be applied and optimized images may not be delivered correctly.

How to Configure Apache .htaccess for CompressX

Step 1: Connect to Your Server

Use an SSH client such as PuTTY, Terminal, or your hosting control panel’s SSH feature to connect to your server. This gives you direct access to your Apache configuration files.

Step 2: Open Your Apache Site Configuration

Once connected, navigate to your Apache configuration directory and open your site’s .conf file. Replace example.com with your actual domain name:

nano /etc/apache2/sites-available/example.com.conf

This file controls how Apache serves your specific site.

Step 3: Enable .htaccess Overrides

Find the <Directory> block that corresponds to your website’s root directory. It may look like this:
<Directory /var/www/>
Within this block, locate the following directive:
AllowOverride None
Change it to:
AllowOverride All
This change tells Apache to allow .htaccess files to override default settings, which is necessary for CompressX’s rewrite rules to work.
apache-configruation-for-compressx

Step 4: Save Your Changes

After updating the directive:

  • 1. Press Ctrl + X to exit the editor.
  • 2. Press Y then Enter to save your changes.

Step 5: Restart Apache

Restart the Apache service to apply the new configuration:

service apache2 restart

Once restarted, Apache will now process .htaccess overrides, and CompressX’s rewrite rules should function correctly.

What Happens Next

With AllowOverride All enabled:

  • 1. CompressX’s .htaccess rules are allowed to execute.
  • 2. Optimized WebP and AVIF images can be served automatically based on browser support.
  • 3. Rewrite errors due to disabled overrides are resolved.
Tips
1. Some hosting environments may not allow SSH access—check with your host if you cannot connect.
2. If you still experience rewrite errors after these steps, double-check your Apache version and modules (mod_rewrite must be enabled).
3. Always back up your configuration files before making changes.

Need Assistance?

If you continue to have trouble after applying these steps, feel free to contact us for help.