403 error when embedding YouTube video

3 posts by 3 authors in: Forums > CMS Builder
Last Post: October 3, 2022   (RSS)

Hi,

Here's the code I use for embedding, which is very similar to yours, except that you're missing the ?rel=0&controls=1&showinfo=0" after the YouTube Short Code (everything after the /embed/).

I use the info 4 field in an image to hold the YouTube Short Code but you can use a separate text field as well

<iframe width="500" height="300" style="border:medium double #333333" src="https://www.youtube.com/embed/<?php foreach ($salon_e_blastsRecord['images'] as $index => $upload): ?><?php echo $upload['info4'] ?><?php endforeach ?>?rel=0&controls=1&showinfo=0" frameborder="0" allowfullscreen></iframe>

The only other differences that I see is the added switches like accelerometer encrypted, etc. I'd try adding the ?rel=0&controls=1&showinfo=0" and possibly eliminating all but the switches that I use and see what happens. Then add them back one at a  time.

Hope that helps

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By daniel - October 3, 2022

Hi CommonSenseDesign,

403 errors are typically generated by the server refusing the request, and so are most commonly due to server configuration rather than the CMS itself. Here are two recent threads that dealt with 403 errors:

In one case it was caused by file permissions, and in the other, it was due to a ModSecurity rule. I would first check to see if you have ModSecurity enabled on the server and if yes, work with your webhost to find out if any rules are blocking the embed.

Let me know if you have any other questions!

Thanks,

Daniel
Technical Lead
interactivetools.com