bluehost / endurance-page-cache

Other
25 stars 12 forks source link

Add <ifModule mod_headers.c> when modifying .htaccess #41

Closed juliolopez78 closed 6 years ago

juliolopez78 commented 6 years ago

Working on a local dev environment set up with Vagrant and I don't have mod_headers.c installed so the plugin's updates to the .htaccess file break my environment, then I have to go in and manually edit the .htaccess file.

I know this plugin was built for bluehost, but some of us devs like to have our dev environment local and only push stuff to prod after it's been tested.

I also know that I could just enable the headers mod on Apache ;)

However, it is convention to wrap rewrite rules with <ifModule>, so why not other directives?

Just change line 417 to look like:

$additions = "<ifModule mod_headers.c>\n" . 'Header set X-Endurance-Cache-Level "' . $this->cache_level . '"' . "\n</ifModule>\n";
MikeHansenMe commented 6 years ago

Thanks for the bug report @juliolopez78. This will be a good addition. We will get it into the next release.

MikeHansenMe commented 6 years ago

Thanks again @juliolopez78. Gonna close this one out.