title: Zend App is not working after deployment. Can access only the homepage
body: <p>I can access the homepage and can get the data from the database. There everything seems OK. But when I try to go to another page from my application I am redirected to <code>404 error page</code>. The URL which is showing at the bottom left corner on my browser when hover the link seems ok.  It is as should be. </p>
  
  <p>I tried to change the <code>.htaccess</code> file on the server from: </p>
  
  <pre><code># Do not remove this line, otherwise mod_rewrite rules will stop working
  
  RewriteBase /
  </code></pre>
  
  <p>To: </p>
  
  <pre><code># Do not remove this line, otherwise mod_rewrite rules will stop working
  
  RewriteBase /
  
  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>But it fails again. Tried different combinations. For example change <code>RewriteBase /</code> to <code>RewriteBase /projectname/public/</code> or <code>RewriteBase /projectname/</code>. Still no success. </p>
  
  <p>Of course, I am not sure if the <code>.htaccess</code> is the problem. May be something different but I have no idea what...</p>
  
  <p>On localhost the application is working and everything is OK there. </p>
  
  <p><strong>Edit:</strong> After several changes that I try I finally get it working. </p>
  
  <h2><em><strong>Here is the solution:</em></strong></h2>
  
  <p>I leaved server's .htaccess file as is. So it has only <code>RewriteBase /</code> on it. 
  Then on the first line of my .htaccess file (which is in the <code>projectname/public</code> folder) I added this:</p>
  
  <pre><code>RewriteBase /projectname/public
  </code></pre>
  
  <p>Now everything is working. </p>