Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

We have an existing Zend Framework site hosted at ourdomain.com and a wordpress blog at blog.ourdomain.com

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.

Does anyone have any ideas?

Virtual host setup:

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

Options Indexes FollowSymLinks

AllowOverride All

Order allow,deny
Allow from all

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
271 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.

An example:

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]

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...