Videos will not Embed (YouTube) Mod Security

I've discovered today that mod security is blocking YouTube videos from embedding. The loading graphic just continues to turn and nothing happens. However, when I disable mod security it works perfectly. Anyone know enough about this as to what instances or changes I can make to correct this issue? This has only just happened recently so I am assuming my host has updated mod security on our VPS.  The version is 7.1.3.

Quote · 1 Sep 2014

I can't say it often enough, but upgrade to 7.1.4.

The 7.1.4 version has many improvements and bug fixes.

Dedicated servers for as little as $32 (28 euro) - See http://denre.com for more information
Quote · 1 Sep 2014

Understand. I have two installations. One at 7.1.3 and one at 7.1.4.  I am working with the host right now hopefully on a solution. The version does not matter. It affects both versions. Mod security is blocking the process.

Quote · 1 Sep 2014

Hello 

You can ask your host to check the mod_security logs and find the ID of the mod_security rule that is met when the video is embed. Then they can disable that rule for your domain's vhost only.

Alternatively, they can disable mod_security for your domain by placing the following lines in your domain's vhost:

<IfModule mod_security2.c>

SecRuleEngine Off

</IfModule>

Good Luck

Quote · 1 Sep 2014

Thanks I will pass this along. I can disable mod security easily but prefer it be present. Thanks.

Quote · 1 Sep 2014

You are most welcome :) Please let us know the results once you have them. In case you need to disable a certain mod_security rule on the server you can use:

 

<IfModule mod_security2.c>

SecRuleRemoveById ID

</IfModule>

where you should change "ID" with the exact number ID of the rule. Since mod_security is quite "flexible", you can even disable it for certain directories or files. 

Regards

Morgan

Quote · 1 Sep 2014

Ok here was the mod security rule causing this problem and how to fix it.

 

If anyone should have this same problem try adding this to your .htaccess

 

<IfModule mod_security2.c>
SecRuleRemoveById 340162
</IfModule>

<IfModule mod_security2.c>
SecRuleRemoveById 340163
</IfModule>

Quote · 1 Sep 2014

I am glad to hear that the issue has been resolved. 

Quote · 2 Sep 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.