GG资源网

Laravel和WordPress前端

问题描述:

I am building a web app on Laravel, which involves logins by multiple user types etc.

I would like to use WordPress backend and frontend for most the CMS related stuff. I want to WordPress frontend, as it is easier to maintain for the client, and a lot of the site\'s user facing pages are content that can be from wordpress.

I want the site to show pages from wordpress, if the route is not being handled by Laravel.

http://webapp.com/ -> (Landing Page)from WordPress

http://webapp.com/laravelRoute -> Laravel

http://webapp.com/some-post-url -> WordPress.

How can I achieve this by letting Laravel and WordPress play nice with routing?

I\'ve tried installing WordPress in public/ folder. However it doesn\'t recognise Laravel routes, works like a general wordpress site.

图片转代码服务由CSDN问答提供

感谢您的意见,我们尽快改进~
功能建议

我正在Laravel上构建一个Web应用程序,它涉及多个用户类型等的登录。</ p>

我想在大多数CMS相关的东西中使用Wordpress后端和前端。 我想要Wordpress前端,因为它更容易为客户端维护,并且很多站点的用户面向页面都是可以来自wordpress的内容。 </ p>

我希望网站显示来自wordpress的页面,如果</ em>路由未由Laravel处理。 </ p>

http://webapp.com/ - &gt; 来自Wordpress的(目标网页)</ p>

http://webapp.com/laravelRoute</ a> - &gt; Laravel </ p>

http://webapp.com/some-post- 网址 - &gt; WordPress的。 </ p>

如何通过让Laravel和Wordpress在路由方面表现出色来实现这一目标? </ p>

我尝试在公共/文件夹中安装Wordpress。 但它不能识别Laravel路线,就像一般的wordpress网站一样。</ p>
</ div>

网友观点:

Here\'s how I was able to fix it.

http://example.com/ -> Laravel code

<laravel code root>/public/pages -> wordpress code

You should be able to access http://example.com/pages/ -> from the wordpress content.

You also need to configure nginx to handle WordPress URL redirects:

###

To merge both Laravel and WordPress on the same level you have two options or maybe more.

The first option is to setup .htaccess rewrite rules and redirect all Laravel routes to a laravel-index.php file. You rename the Laravel app index.php file to that.

The second option is to disable the wordpress index.php file and instead use Laravel\'s. In laravel create a catch all route that call the WordPress object. So with this method, all you have to do is create the Laravel routes and the rest will just fall through to WordPress.

由于网站搬家,部分链接失效,如无法下载,请联系站长!谢谢支持!
1. 带 [亲测] 说明源码已经被站长亲测过!
2. 下载后的源码请在24小时内删除,仅供学习用途!
3. 分享目的仅供大家学习和交流,请不要用于商业用途!
4. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
5. 本站所有资源来源于站长上传和网络,如有侵权请邮件联系站长!
6. 没带 [亲测] 代表站长时间紧促,站长会保持每天更新 [亲测] 源码 !
7. 盗版ripro用户购买ripro美化无担保,若设置不成功/不生效我们不支持退款!
8. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
9. 如果你也有好源码或者教程,可以到审核区发布,分享有金币奖励和额外收入!
10.如果您购买了某个产品,而我们还没来得及更新,请联系站长或留言催更,谢谢理解 !
GG资源网 » Laravel和WordPress前端

发表回复

CAPTCHAis initialing...
© 2021-GG资源网 - www.ggplus.cn. All rights reserved