[英]How to integrate wordpress blog into a custom Single page app website hosted on AWS using AngularJS
I have a custom website that is hosted on AWS managed using Elastic BeanStalk. 我有一个自定义网站,该网站托管在使用Elastic BeanStalk管理的AWS上。 The web app is built using ANgularJS framework.
该网络应用是使用ANgularJS框架构建的。 I have a separate blog hosted on wordpress.
我在wordpress上托管了一个单独的博客。 I would like to migrate and integrate this blog into existing website.
我想将该博客迁移并集成到现有网站中。 Has anyone had experience with this?
有人对此有经验吗? If so can i get some pointers on how to proceeed here.
如果是这样,我可以在这里获得一些如何进行的指示。
Example. 例。 my custom website is mywebsite.com Current wordpress blog is myblog.com I want to create mywebsite.com/blog and have all my wordpress blog content integrated into mywebsite.com/blog
我的自定义网站是mywebsite.com当前的wordpress博客是myblog.com我想创建mywebsite.com/blog,并将我所有的wordpress博客内容集成到mywebsite.com/blog中
You can use AWS CloudFront for this. 您可以为此使用AWS CloudFront。 Include the Blog and the Angular App as two origins and add behaviors accordingly to route.
将Blog和Angular App包括为两个来源,并相应地添加行为以进行路由。 Map your domain name to AWS CloudFront.
将您的域名映射到AWS CloudFront。
eg Create a behavior for /blogpost to point to Wordpress origin. 例如,为/ blogpost创建一个行为以指向Wordpress的起源。 mywebsite.com/blogpost -> WordpressDNS/blogpost
mywebsite.com/blogpost-> WordpressDNS / blogpost
If you have URL rewrite requirement, use Edge Lambda to code the URL rewrite logic. 如果您有URL重写要求,请使用Edge Lambda编写URL重写逻辑。
For more details in setting up Wordpress behind CloudFront refer this blog post. 有关在CloudFront背后设置Wordpress的更多详细信息,请参阅此博客文章。 In addition you will need to install a Wordpress Plugin to avoid Mixed Content issues (If you setup SSL for your website).
此外,您将需要安装Wordpress插件来避免混合内容问题(如果您为网站设置了SSL)。
You have some options I can think of: 您可以想到一些选择:
A: You could simply do a wordpress installation in the blog directory, of course needing php/mysql running on your environment. 答:您只需在blog目录中进行wordpress安装,当然需要在您的环境中运行php / mysql。
B: You could install wordpress and use it as a back end and use Angular as your front end so that it easily integrates with your current app. B:您可以安装wordpress并将其用作后端,而将Angular用作前端,以便轻松地与当前应用程序集成。 The front end would consume data from the WP API.
前端将消耗WP API中的数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.