We now have a current Zend Framework site located at ourdomain.com along with a wordpress blog at blog.ourdomain.com
You want to migrate your blog in to the site at ourdomain.com/blog - however i appeared to possess researched towards the finish of the world and can't discover how. I've attempted various .htaccess stuff, establishing your blog controller and including some wordpress files, etc - but with no success.
Does anybody have ideas?
virtual host setup:
ServerAdmin website email@example.com DocumentRoot "/Customers/bradyeager/Sites/TWPZend/public" ServerName twps ErrorLog "logs/twps-error-log" CustomLog "logs/twps-access_log" common
Options Indexes FollowSymLinks
AllowOverride All Order allow,deny Allow all
The best and simplest way to do this by modifying your .htaccess file not to send something that begins with
/blog towards the ZF application -- just pass it right through to Wordpress. Wordpress would need to be installed within your document root, obviously, with this to operate, just how you'd normally do the installation.
A good example:
RewriteCond % -s [OR] RewriteCond % -l [OR] RewriteCond % -d RewriteRule ^.*$ - [NC,L] RewriteRule ^blog - [NC,L] RewriteRule ^.*$ index.php [NC,L]
All of this nonsense about producing custom remotes, actions and routes inside your ZF application, then passing on Wordpress via your application is completely absurd. You would be performing a complete dispatch cycle of the application's engine, simply to forward on another application?
Among the best articles about moving a non-ZF site into ZF comes from Chris Abernethy.
As if you, he creates a unique controller for individuals non-ZF handled script. However, he (eventually) creates ZF-routes akin to individuals non-ZF pages, instead of experimenting with exterior .htaccess.
May not apply straight to your situation, as your example involves a subdomain while his involves pages around the same domain. But you will find good quality ideas inside that could be useful.
I frequently make use of this configuration really , some tips about what I actually do:
/application /library /Zend /wordpress ( symlink to my wordpress folder ) /public index.php ( i add wordpress &lifier the zend folder to my include path )
Of course a little of the brutal solution , thinking about all of the unnecessary stuff that's incorporated along the way...
// Define road to application directory defined('APPLICATION_PATH') define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')) // Define application atmosphere defined('APPLICATION_ENV') define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production')) // Ensure library/ is on include_path set_include_path(implode(PATH_SEPARATOR, array( realpath(APPLICATION_PATH . '/../library'), realpath(APPLICATION_PATH . '/../library/wordpress'), get_include_path(), ))) //Obtain the wordpress atmosphere define('WP_USE_THEMES', false) require_once 'wp-blog-header.php' /** Zend_Application */ require_once 'Zend/Application.php' // Create application, bootstrap, and run $application = new Zend_Application( APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' ) $application->bootstrap() ->run()
Begin to see the correct answer supplied by Jason. Just make certain your wordpress .htacess file is spinning towards the correct index.php Automatically, it'll rewrite to the bottom index.php - which goes to Zend. My solutions ended up being to change Wordpress' .htaccess RewriteBase to /blog rather than /