how to configure htaccess in zend framework

2019-09-21 06:52发布

问题:

I cannot access other modules(pages). I can access only public directory http://localhost:88/hotelrwanda/public. I put the project into development mode and enable error display but nothing. Here is what message I get if I want to access to for the following url http://localhost:88/hotelrwanda/public/users/list

Not Found

The requested URL /hotelrwanda/public/users/list was not found on this server.

Here is my htaccess file;

SetEnv APPLICATION_ENV development
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

回答1:

Possible duplicate of Zend mod rewrite not working

I believe the issue is that AllowOverride is set to none for the web directory you are using which means the .htaccess file will not be processed. You will have to edit httpd.conf and set AllowOverride All.

Also make sure you create a Bootstrap file for each module, as the autoloading is not set up for modules unless you have a module bootstrap.