0

I made a simple site with python-flask and hosted it on heroku. I also have a wordpress website where I often post article about python. Now I want to embed the whole heroku site to a alias of my wordpress Website. Suppose, My wordpress is on my-wp-web.xyz and my heroku website is on simple-flask-app.herokuapp.com. Now I want to access simple-flask-app.herokuapp.com from my-wp-web.xyz/flask-app without redirecting. Is there any DNS settings, wp plugins or anything?
Note: The wp site was hosted from Direct Admin not from CPanel.

ZARIR
  • 31
  • 10
  • Hello there. Well, if you dont want to change address or redirect etc., try an iframe? – somdow Aug 15 '22 at 03:38
  • Noo... Iframe isn’t responsive. And If I click any link on iframe, only the content will change, not the address‍ Let's say I am at `simple-flask-app.herokuapp.com`, after clicking a link I am redirected to `simple-flask-app.herokuapp.com/profile`. Now I want that profile page at `my-wp-web.xyz/flask-app/profile`. I hope you understood – ZARIR Aug 15 '22 at 09:23

1 Answers1

1

After reading your query, I mentioned in the comments about iFrames. You mentioned that Iframes are not responsive. They normally are not but you have to work a little bit to make them work. Here is a post on SO that does just that.

Making an iframe responsive

Now if you still don't want to use iFrames, then the only thing(s) I can think of is either loading your website into a container div via

  1. jquery .load() https://api.jquery.com/load/ This will let you load an entire website portion into a div of your choosing, or a specific section etc.

  2. You can also try DOMAIN MASKING. Essentially, you still redirect the user but mask the address so that it looks like the user is still in the same location. As long as your application looks similar to your Wordpress website visually, then it should be good enough.

hope this helps steer you in the right direction. Happy coding.

somdow
  • 6,268
  • 10
  • 40
  • 58