Why can't I view the public folder of Zend Framework Project?
I recently started learning zend framework. I am trying to access the index.php inside the public folder, but when i test the project using WAMP server in browser, I can't find the public folder in the web root. I can see other folders like applications, library, docs but there isn't any public folder.
Why can't I view the public
folder of开发者_开发技巧 Zend Framework Project?
UPDATE my .htacess file inside the /public folder
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
UPDATED You need to enable Apache's mod_rewrite. To do this
Find the httpd.conf file (usually you will find it in a folder called conf, config or something along those lines)
Inside the httpd.conf file uncomment the line
LoadModule rewrite_module modules/mod_rewrite.so
(remove the pound '#' sign from in front of the line)Also find the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out.
For Further information, go to the source http://www.astahost.com/info.php/Apache-Tutorial-Enable-Mod_rewrite-Windows_t11623.html
PREVIOUS If you set up your virtual host the default way, i.e.
<VirtualHost *:80>
DocumentRoot "C:/Users/user/www/yourdomain.dev/public"
ServerName .local
# This should be omitted in the production environment
SetEnv APPLICATION_ENV development
<Directory "C:/Users/user/www/yourdomain.dev/public">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
You may access the public dir, by:
http://yourdomain.dev/
and files in public dir by:
http://yourdomain.dev/filename.ext
It is all about DocumentRoot
.
精彩评论