Zend Framework and Wordpress Integration(Zend 框架和 Wordpress 集成)
问题描述
我们在 ourdomain.com 上有一个现有的 Zend Framework 站点,在 blog.ourdomain.com 上有一个 wordpress 博客
We have an existing Zend Framework site hosted at ourdomain.com and a wordpress blog at blog.ourdomain.com
我们想将博客迁移到位于 ourdomain.com/blog 的站点中 - 但我似乎已经用谷歌搜索到了地球的尽头,无法找到方法.我尝试了各种 .htaccess 的东西,设置了一个博客控制器并包括一些 wordpress 文件等 - 但无济于事.
We want to migrate the blog into the site at ourdomain.com/blog - but I seemed to have googled to the end of the earth and cannot find out how. I have tried various .htaccess stuff, setting up a blog controller and including some wordpress files, etc - but to no avail.
有人有什么想法吗?
虚拟主机设置:
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/Users/bradyeager/Sites/TWPZend/public"
ServerName twps
ErrorLog "logs/twps-error-log"
CustomLog "logs/twps-access_log" common
期权索引 FollowSymLinks
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
推荐答案
最有效和最简单的方法是通过修改 .htaccess 文件而不将任何以 /blog
开头的内容发送到ZF 应用程序——只需将其传递给 Wordpress.Wordpress 必须安装在您的文档根目录中,当然,要使其正常工作,这与您通常的安装方式完全相同.
The most efficient and easiest way to accomplish this by modifying your .htaccess file to NOT send anything that starts with /blog
to the ZF app -- just pass it through to Wordpress. Wordpress would have to be installed inside your document root, of course, for this to work, exactly how you would normally install it.
示例:
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^blog - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
关于在您的 ZF 应用程序中创建自定义控制器、动作和路由,然后通过您的应用程序传递到 Wordpress 的所有这些废话绝对是荒谬的.您会执行应用程序引擎的完整调度周期,只是为了转发到另一个应用程序?
All this nonsense about creating custom controllers, actions and routes in your ZF app, then passing off to Wordpress via your app is absolutely ridiculous. You'd be executing a full dispatch cycle of your application's engine, just to forward off to another app?
这篇关于Zend 框架和 Wordpress 集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Zend 框架和 Wordpress 集成


基础教程推荐
- 找不到类“AppHttpControllersDB",我也无法使用新模型 2022-01-01
- 在 CakePHP 2.0 中使用 Html Helper 时未定义的变量 2021-01-01
- 如何在 Symfony 和 Doctrine 中实现多对多和一对多? 2022-01-01
- HTTP 与 FTP 上传 2021-01-01
- 使用 PDO 转义列名 2021-01-01
- phpmyadmin 错误“#1062 - 密钥 1 的重复条目‘1’" 2022-01-01
- 在 yii2 中迁移时出现异常“找不到驱动程序" 2022-01-01
- 如何在 XAMPP 上启用 mysqli? 2021-01-01
- Doctrine 2 - 在多对多关系中记录更改 2022-01-01
- PHP 守护进程/worker 环境 2022-01-01