Streamlit Cloud Redirects Too Many Times

I seem to have a bit of an issue embedding my streamlit cloud-hosted site into GitHub pages - I’m trying to use an iframe embed that this thread claims is the way to use a custom domain, but end up getting what seems to be a loop of redirects that cause the page to fail to load:

image
image

This issue seems to prevail regardless of the browser I use; I also tried running the html file locally and still encountered the issue. When I started testing the site, it initially worked, but eventually caused this error (I didn’t change anything, the issue seems to have come up after loading the site a few times). I also tried clearing my browser’s cache and cookies, but that didn’t work.

The relevant html embed code:

image
I initially had a //embed?=true added to the end of the url, but that made my embedded app unresponsive.

Streamlit cloud share link: https://code49-personalwebsite.streamlit.app/ (works fine, when I open up the developer tools I don’t see the same redirect chain that I do when it’s embedded).

Link to the (attempt at) a site: https://davidlechan.dev/

GitHub repo for the whole project: https://github.com/code49/personalWebsite

Any thoughts on what I might do? It seems like this has something to do with the way I embed the applet into the iframe, but I’m not sure.

1 Like

Hi @code49_a,

Welcome to the Streamlit forum! :wave: :balloon:

That thread you reference is outdated. Take a look at our docs on how to Embed apps. The right query parameter to append to your iframed URL is /?embedded=true. i.e.

<iframe src="https://code49-personalwebsite.streamlit.app/?embedded=true"></iframe>

Using /?embed=true instead will hide the scrollbars and hamburger menu in embedded apps.

4 Likes

Worked perfectly! Thank you so much!

This did not work for me. It still says that share.streamlit.io redirected you too many times for my already deployed app with the correct URL.

The documentation for embedding apps has changed a bit since this answer was posted. For reference, the current parameter is ?embed=true instead.

<iframe
  src="https://roadmap.streamlit.app/?embed=true"
  height="450"
  style="width:100%;border:none;"
></iframe>
1 Like