title: Zend and .htaccess
body: <p>My default 'zend' app has this default structure</p>
  
  <pre><code>/zend + webroot
      /application
      /config
      /library
      /public
          .htaccess
          index.php
  </code></pre>
  
  <p>and the default .htaccess redirects the various controller/action details via ./public/index.php</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} -s [OR]
  RewriteCond %{REQUEST_FILENAME} -l [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^.*$ - [NC,L]
  RewriteRule ^.*$ index.php [NC,L]
  </code></pre>
  
  <p>I use this default url to access the app</p>
  
  <pre><code>http://domain/index.php
  </code></pre>
  
  <p>I've now moved to a shared host, where the webroot is above the 'zend' root.</p>
  
  <pre><code>/webroot
      /zend
          /application
          /config
          /public
              index.php
             .htaccess
  </code></pre>
  
  <p>but i can only access my app via this URL</p>
  
  <pre><code>http://domain/zend/public/index.php
  </code></pre>
  
  <p>i want to be able to use</p>
  
  <pre><code>http://domain/zend/index.php
  </code></pre>
  
  <p>and have .htaccess redirect.</p>
  
  <p>and i'm wondering how i can tweak the .htaccess file to redirect the URL requests. I read
  this <a href="http://www.alberton.info/zend_framework_mod_rewrite_shared_hosting.html" rel="noreferrer">tutorial</a> but i didn;t work for me</p>
  
  <pre><code>/webroot
      /zend
          .htaccess
          /application
          /config
          /library
          /public
              index.php
  </code></pre>
  
  <p>This is the .htaccess content in this case</p>
  
  <pre><code>RewriteEngine On
  
  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]
  </code></pre>
  
  <p>Can anybody spot anything?</p>