Navigate back to the homepage

refused to display 'url' in a frame because it set 'x-frame-options' to 'sameorigin'

March 31st, 2021 · 1 min read

Hello Friends 👋,

Welcome To Infinitbility! ❤️

The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>, <iframe>, <embed> or <object>. Sites can use this to avoid click-jacking attacks, by ensuring that their content is not embedded into other sites.

The added security is provided only if the user accessing the document is using a browser that supports X-Frame-Options.

You are trying to embed video or show pdf in your website and getting error like below

refused to display ‘url’ in a frame because it set ‘x-frame-options’ to ‘sameorigin’

well solution depends upon which url want show in your website.

Youtube url

when trying show youtube video on your website then you have to remove watch?v= with embed/

For example: to

It works well.

Apache server url ( your server )

when your node, php, and backend language using apache server then you have to set header like below example

Go to your your conf available folder

1$ cd /etc/apache2/conf-available

Edit default-ssl.conf or your domain conf virtualhost

Add header with “SAMEORIGIN”

1Header always set X-Frame-Options "SAMEORIGIN"

when your diffrent origin

1Header always set X-Frame-Options "ALLOW-FROM"

Thanks for reading…

Follow me on Twitter

Join our email list and get notified about new content

No worries, I respect your privacy and I will never abuse your email.

Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.

Looking For React Native Tutorial?

we are trying to create the best Tutorial for react native developers.

When you want a daily updates about React Native Tutorial or infinitbility update subscribe to our newsletter.

Read React Native Tutorial

Request New Tutorial or Article on mail [email protected]

Guide book

Guidebook: The Javascript Monorepo Photoshop Guide



More articles from Infinitbility

How to select and upload video in react native

Example of select and upload video in react native

March 27th, 2021 · 1 min read

Network request failed in react native fetch

Solve HTTP and HTTPS Network request failed issue in react native fetch

March 15th, 2021 · 1 min read
© 2020–2022 Infinitbility
Link to $ to $ to $ to $ to $ to $mailto:[email protected]