Maybe a stupid question, but this shouldn't be too hard to achieve :D I have a shared server (CentOS - PLESK - Apache - PHP) and have modpagespeed enabled for just 1 domain. It all works, but every other domain is affected and a pain in the *** to disable.
I'm looking for a solution to manage / enable|disable this MOD for the hosted domains. It would be a hard knock to go through every domains .htaccess file and set the ModPagespeed off for every instance :-(
Maybe I could serve 2 different .htaccess files in the future.. one with ModPagespeed on, and one with ModPagespeed off. If there's an easy way to bulk-edit the .htaccess files, I would like to know how ;-)
I hope someone out here has an answer for me! Thank you very much in advance!
Your best solution of this is a script that will modify (add or remove ModPagespeed) line from
.htaccessfile.First though you'd have to add a line (either disable or enable) to every file/domain and then create a simple script that would seache for
.htaccessfiles in/etc/apache2/sites-enabled/and modify the line in them.For this task you can use
findwith[sed][1]of[awk][1];find . -type f -name '.htaccess' -exec sed -i.bak 's|http://|rtmp://|g' {} +This is simply modified viersion of the one you will find in this answer.
If you run many servers (if it's a few then running a script manually on each of them shouldn't be a big deal) you can additionally make it to log in to every machine and make appropriate changes.
Scripting is in my opinion the only way to achieve this in some reasonable easy way.