title: Zend Framework - Include JS does not work on new System
body: <p>I have a problem with ZF on my new server during JS file inclusions.
  Including external JS (google api) is no problem.
  It seems, that zf want to load the JS files not relative. </p>
  
  <p>The errormessage, displayed by FireBug in the Srcipt Tag of the html Console:</p>
  
  <pre><code>&lt;script src="/javascript/helper.js" type="text/javascript"&gt;
  
  &lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"&gt;
  &lt;html&gt;&lt;head&gt;
  &lt;title&gt;404 Not Found&lt;/title&gt;
  &lt;/head&gt;&lt;body&gt;
  &lt;h1&gt;Not Found&lt;/h1&gt;
  &lt;p&gt;The requested URL http://project/javascript/helper.js was not found on this server.    &lt;/p&gt;
  &lt;hr&gt;
  &lt;address&gt;Apache/2.2.16 (Debian) Server at domain.squeeze Port 80&lt;/address&gt;
  &lt;/body&gt;&lt;/html&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>The page does not load the scripts, because it tries to get the files by the full url. This cannot work, because of the rewrite rules.
  After I tried hundreds of things, I got these error at the same place:</p>
  
  <pre><code>&lt;p&gt;The requested URL /javascript/helper.js was not found on this server.&lt;/p&gt;
  </code></pre>
  
  <p>But this is the right relative link.</p>
  
  <p>My Structure:</p>
  
  <pre><code>/var/www/project/
             --&gt;application
             --&gt;...
             --&gt;public
                --&gt;javascript
                   helper.js
                   &lt;other JS Files&gt;
               index.php
               .htaccess
  </code></pre>
  
  <p>When I searched for this error, I found these possible reasons:</p>
  
  <ol>
  <li>Wrong or missing baseURL</li>
  <li>Mod rewrite not enabled</li>
  <li>Missing or bad .htaccess file in public</li>
  <li>Missing "Allow Override = All" in the vHost</li>
  <li>no leading "/" slash in the relative path of the file</li>
  </ol>
  
  <p>None of them fits to my problem.</p>
  
  <ol>
  <li>I have no deeper "baseURL", so my default path is "" by directing the vhost directly in my /project/public folder</li>
  <li>Mod rewrite is enabled, I can browse any page, controller, action</li>
  <li>.htaccess is default and present</li>
  <li>Allow Override is set to All, my rewrite rules work fine with the rest of the project</li>
  <li>I try it without "/" in the beginning. No effect</li>
  </ol>
  
  <p>My layout has this inclusion methods for JS:
  --> layout.phtml</p>
  
  <pre><code>$this-&gt;headScript()-&gt;appendFile('/javascript/jquery_1.6.2/jquery.js','text/javascript');
        $this-&gt;headScript()-&gt;appendFile('/javascript/jqueryui_1.8.16/jquery-ui.min.js','text/javascript');
      $this-&gt;headScript()-&gt;appendFile('/javascript/jquery.metadata.js','text/javascript');
      $this-&gt;headScript()-&gt;appendFile('/javascript/jquery.validate.js','text/javascript');
      $this-&gt;headScript()-&gt;appendFile('/javascript/jquery.fileupload.js','text/javascript');
      $this-&gt;headScript()-&gt;appendFile('/javascript/jquery.fileupload-ui.js','text/javascript');
  
      $this-&gt;headScript()-&gt;appendFile('/javascript/methods_de.js','text/javascript'); 
      $this-&gt;headScript()-&gt;appendFile('/javascript/helper.js','text/javascript');*/
      echo $this-&gt;headScript();
  </code></pre>
  
  <p>The confusing thing is, that the stylesheet inclusion works. This is the same technic</p>
  
  <p>I include them by </p>
  
  <pre><code>$this-&gt;headLink()-&gt;appendStylesheet('/css/layout.css');
  echo $this-&gt;headLink();
  </code></pre>
  
  <p>My .htaccess:</p>
  
  <pre><code>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]
  </code></pre>
  
  <p>I have several ZF projects running on debian lenny and they work without any problems.
  Now I set up two debian squeeze and on both systems I got these problems.</p>
  
  <p>If I copy the project folder to a lenny system (same vhost config), it works fine. </p>
  
  <p>May be someone has a idea how I can fix this...</p>
  
  <p>Thx a lot</p>