title: Magento URLs other than home page do not work without index.php
body: <p>My magento is installed on Ubuntu Linux under /var/www/magento .
  This question looks like some of the questions in the archives
  but is acutally somewhat different. When I installed Magento on
  Ubuntu Linux I enabled Apache mod_rewrite URL rewrites.</p>
  
  <p>When I go to http:// localhost/magento
  my server rewrites the URL as http:// localhost/magento/
  and displays the page. I then click on one of the links
  in the navigation bar, let's say it's nav-bar item "foo".
  Then magento takes me to:</p>
  
  <p>http:// localhost/magento/foo.html</p>
  
  <p>which displays a "Not Found" apache page.</p>
  
  <p>I have to change the URL to -----></p>
  
  <p>http:// localhost/magento/index.php/foo.html</p>
  
  <p>in order to display the page.</p>
  
  <p>It is as though something is amiss in my mod_rewrite workings.</p>
  
  <p>Thanks,</p>
  
  <p>John Goche</p>
  
  <p>CONFIGURATION: System -> Configuration -> (General ->) Web:</p>
  
  <p>Use Web Server Rewrites: YES</p>
  
  <p>Base URL: http:// localhost/magento</p>
  
  <p>If I set "User Web Server Rewrites:" to NO, then the links
  from my main page work fine, but see the page
  http:// localhost/magento/index.php/foo.html
  which displays the correct page, but whereas
  the website works I don't like the URL. I
  would like it to be http:// localhost/magento/foo.html
  without the index.php bit, as this would also probably
  be more SEO-friendly.</p>
  
  <p>THanks,</p>
  
  <p>John Goche</p>
  
  <hr>
  
  <p>Update: I've tried uncommenting my artificial 127.0.1.1 IP address
  which ubuntu had put in /etc/hosts and placing ther my real IP but
  no luck. I still have exactly the same problem. And the URL inside
  my browser is rewritten to http:// localhost / etc... whenver I
  type 192.168.3.31, avalanche, or avalanche.com inside it.
  I am still trying to figure out how to solve the problem
  described above as this did not do it.</p>
  
  <pre><code>127.0.0.1       localhost
  #127.0.1.1      avalanche
  
  192.168.4.35    avalanche avalanche.com
  </code></pre>
  
  <p>When I restart Apache I get:</p>
  
  <pre><code># service apache2 restart
   * Restarting web server apache2                                                apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.4.35 for ServerName
   ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.4.35 for ServerName
  </code></pre>
  
  <p>Not sure how to fix the original issue. I am testing on a local server.</p>
  
  <hr>
  
  <p>I've even tried this solution and then restarted apache2, but no luck!</p>
  
  <p><a href="https://stackoverflow.com/questions/10474740/magento-how-to-remove-index-php-from-urls">How to remove index.php from URLs?</a></p>
  
  <p>so placing:</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /mymagento/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L]
  </code></pre>
  
  <p>does not work, even with RewriteBase /, it does not work.</p>
  
  <hr>
  
  <p>OK, finally I managed to solve the probkem.
  The file /etc/apache2/sites-enabled/000-default
  has the following directive set for all directories
  defined within this file:</p>
  
  <pre><code> AllowOverride None
  </code></pre>
  
  <p>For instance, for /var/www which is the default document root
  set on Ubuntu 12.04 LTS Linux system this file contains</p>
  
  <pre><code>    &lt;Directory /var/www/&gt;
              Options Indexes FollowSymLinks MultiViews
              AllowOverride None
              Order allow,deny
              allow from all
      &lt;/Directory&gt;
  </code></pre>
  
  <p>which as far as I understand means that .htaccess files found in
  this directory and all of its subdirectories will not be parsed.
  To fix the problem it is sufficient to set:</p>
  
  <pre><code>AllowOverride All
  </code></pre>
  
  <p>meaning you will be able to override the server configuration directives
  found in /etc/apache2/apache2.conf (or /etc/apache2/httpd.conf which is
  included therein).</p>
  
  <p>One of the reasons AllowOverride is set to None by default could be that
  it slows down the server and the other is for security reasons. This
  directive should be set inside a  tag and the
  latter ones can override the former. Another reason this is not
  set by default is that having to parse .htaccess recursively
  across the site each time a file in a directory path is
  loaded can slow down the system and thus placing the
  .htaccess stuff in /etc/apache2/httpd.conf when
  possible is recommendable as it can cause an
  increase in speed.</p>
  
  <p>So place</p>
  
  <pre><code>    &lt;Directory /var/www/&gt;
              Options Indexes FollowSymLinks MultiViews
              #AllowOverride None
              AllowOverride All
              Order allow,deny
              allow from all
      &lt;/Directory&gt;
  </code></pre>
  
  <p>inside /etc/apache2/sites-enabled/000-default</p>
  
  <p>and run: service apache2 restart</p>
  
  <p>is the solution.</p>