I suppose all of you be aware of LoadModule directive form mod_so. I wish to perform the opposite, unload module for specific directory via .htaccess file. Does UnloadModule exist?

I wish to achieve greatest script compatibility by *crippling all modules except mod_rewrite*, because undesirable modules are playing with my script in some manner. Can there be an smart way?

Side question: How you can disable mod_deflate only? It's the greatest badass. I wish to handle compression internally during my scripts.

1. It isn't feasible to unload already loaded module. That's all things i know on #1.

2. Let us put this code inshtaccess:

<IfModule deflate_module>
    # Insert filter
    SetOutputFilter DEFLATE
    # Don't compress images
    SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

    <IfModule headers_module>
        # Make sure proxies don't deliver the wrong content
        Header append Vary User-Agent env=!dont-vary

This can compress .html files (as lengthy s it's large enough, obviously).

Now, let us add html towards the listing of excluded extensions:

    SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|html)$ no-gzip dont-vary

Now reload exactly the same html file in browser (make certain browser really loads it fresh (ought to be 200 response) and never from cache or via 304 Not Modified response). It now transmits html file without any compression whatsoever. Firebug verifies: only 480 bytes when compressed and 11.6 KB of uncomressed data (the html file is essentially just one paragraph of text repeated 20 approximately occasions, hence the good compression).

I am sure you are able to modify it for your needs effortlessly (on my small server compression isn't enabled globally -- that's the code I personally use after i require it -- and so i cannot provide 100% exact code for you personally, regrettably). For instance:

SetEnvIfNoCase Request_URI .+$ no-gzip dont-vary

You are able to prevent a module from being loaded to begin with simply by not getting a LoadModule directive for that module under consideration inside your configuration whatsoever.