how to run wordpress and zendframework from the same docroot
I have a site running in wordpress
in shared hosting terria.net
I have developed another project in zend
framework and have deployed under a tools directory,
I would like to access it www.abc.com/tools
.
I have copied the content of .htaccess
mentioned by Lorenzo Albertons in tools/.htaccess
.
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
R开发者_C百科ewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$ /public/index.php [NC,L]
But the url is not properly redirected to the tools project rather it is treating it as a wordpress
page.
If www.abc.com
points to your ZF app's public
directory, then anything you put in there should be accessible via the appropriate URL segment using Zend's default .htaccess settings (the re-writing only kicks in if there isn't a physical folder or file already present).
We run a Wordpress site in our ZF application by just adding a symlink to the blog
folder into the public
directory, and access it via wwww.abc.com/blog
.
For the record, we're using the follow rewrite rules (which I believe are default if you're use Zend's project generator, or at least were in ZF 1.8):
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
精彩评论