問題描述
我們在 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 集成的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!