I have a ZF1.11.12 application with a WordPress install located at /public/blog on a shared host. I’m using .htaccess to redirect all requests to /public with:
RewriteEngine On
# Exclude some directories from URI rewriting
#RewriteRule ^(dir1|dir2|dir3) - [L]
RewriteRule ^.htaccess$ - [F]
RewriteCond %{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]
In the public folder, I’m using a second .htaccess to direct all requests to index.php (per standard ZF convention) save requests to two directories – /blog and /app. Code is a follows:
SetEnv APPLICATION_ENV production
SetEnv MAGIC_QUOTES 0
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^blog - [NC,L]
RewriteRule ^app - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
Everything seems to be functioning correctly except that
- When I navigate to my WP login page(/blog/wp-login.php), it’s routing back through ZF and throwing a 404 exception (incorrect controller)
- When I navigate to /blog I’m getting redirected to /blog/blog/ but when I navigate to /blog/ (with trailing slash) I’m correctly sent the blog home page. Requests to all other WP posts work just fine.
Even more confusing, I’m have no problem accessing my wp login in my local environment. Any help would be appreciated! URL is www.lajollabluebook.com
I’m currently adding our WP site together with Zend 1.11. I’ve added the WP site to
public/about/
(for our case).I have not had to touch the Zend
.htaccess
file inpublic/
(using what was already there, which has no mention of our newabout
dir).In the WP
.htaccess
file (public/about/
), I editedRewriteBase
andRewriteRule
to the following:I’m able to go everywhere on our WP site under [url]/about/[the-rest-of-WP-site]. I think I had to delete cache or cookies or something for it to work (don’t remember).
Hope that helps.