Search code examples
angularwordpressapacheiisumbraco

Routing to an external application (such as Wordpress) in Angular


I am building an Angular 9 application and I'd like the /blog route of this site to be a separate application running either Wordpress or Umbraco but I have no idea how I can get Angular to ignore this specific route. Whether this opens a separate browser tab or does a complete page redirect is not important, but I need some way to get there without Angular getting involved.

I also have not chosen which webserver I am going to use yet, I guess it's either IIS or Apache, but I'd also like to know what I'd need to set up on the webserver to make this possible.

Thanks for your time.


Solution

  • Disclaimer. As an Umbraco dev, it's a pretty narrow sighted answer.

    Integrating both front-ends gives you lots of issues which will never have the "best" solution. It will always be a workaround. You will have lots issues whether you try to integrate with iframes, hosting sub applications, using a reverse proxy, ...

    I think there are only two good solutions:

    The easiest way is probably open a new window (_target=blank) and redirect (301) to a separate website (eg blog.yourdomain.com).

    Or secondly: Only use the umbraco backend, do not develop any front-end in Umbraco. Throw in some API endpoints on your umbraco where you retrieve the information about your blog and show the blog posts inside of your angular9 application. This approach will save you all the editor/backend development for the blog.

    eg add a blogController with a summary and a detail(id) method which return the json. That json can then be interpreted by your Angular app.

    Sidenode, there is a commercial product (umbraco heartcore) which is build for this purpose. But you can choose to install a free Umbraco "on premise" and do it yourselves.