Rob Allen-3 wrote:
> 
> 
> Out of interest, do you have a .htaccess file in your project root  
> folder to redirect all traffic to the ./public?
> 
> 

My index.php/.htaccess setup is modified a bit...
I have an .htaccess file in my project root folder that rewrites all
requests to a index.php which is also in my project root folder. For any
images/css/js/etc. that I want to access from my project/public/ folder, I
have a rewrite filter to allow them through based on file extension:

   RewriteEngine on
   RewriteRule !\.(js|ico|gif|jpg|png|css|mpg|avi|swf|html|htm)$ index.php

Files within project/public/ are accessed via: 
     http://host/project/public/css/styles.css

Controller actions are accessed via:
     http://host/project/module/controller/action

My structure looks like:

webroot/
   project1/   (accessed via http://host/project1)
      .htaccess (Rewrite to ./index.php)
      index.php (hooks to app/Bootstrap.php)

      app/
         .htaccess (deny from all)
         Bootstrap.php
         config/
         layouts/
         modules/
         tests/
         tmp/
         tools/

      public/
         css/
         files/
         img/
         js/
     
   project2/...
   project3/...

I did this so I wouldn't have to see
http://host/project/public/module/controller/action... so it's mainly
personal preference. There are pros and cons to either approach. It is great
that apache and ZF are flexible like this.

And again to note, this is all because my host provider is limited - It is
more secure to use virtual directories pointing to your /public and keeping
your code out of the webroot.

Cheers!
-- 
View this message in context: 
http://www.nabble.com/Framework-setup-for-local-dev.-and-shared-hosting.-tp20108467p20137349.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to