I have in my site a WordPress running in the root directory, ie: mysite.com/
And I need to create a ZF Application, and host it under a subdirectory of my hosting, ie: mysite.com/backend
I did under my root directory:
% zf create project backend
It created the “backend” directory under my root, with all the project inside.
Under my root directory I have this .htaccess file:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Under webroot/backend/public I have this .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
I’m using ZF 1.11
What I can’t figure how must I configure is the .htaccess files to get this zf app working under the subdirectory.
Regards!
I had to put this .htacess inside mysite.com/backend
And then in my Bootstrap.php this:
So Zend can route the requests in the right way.