403 error when embedding YouTube video
3 posts by 3 authors in: Forums > CMS Builder
Last Post: October 3, 2022 (RSS)
Hi, All. I'm trying to embed a YouTube video in a blog post using the code that YT generates. Whenever I attempt to save the page, I get a 403 error message.
The field has been set up to accept MP4 and MPEG files.
Any suggestions for how to fix this, please?
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
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:
- https://www.interactivetools.com/forum/forum-posts.php?postNum=2246151#post2246151
- https://www.interactivetools.com/forum/forum-posts.php?postNum=2246041#post2246041
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,
Technical Lead
interactivetools.com