title: How to activate mod_rewrite?
body: <p>I know that this question have been asked several times. But I can't get it to work.</p>
  
  <p>I installed Apache2 in my Ubuntu server I can also confirm that mod_rewrite is installed using phpinfo();. I have also put a file called .htaccess in my root folder(/var/www/.htaccess). In my .htaccess file I paste the following code:</p>
  
  <pre><code>Options +FollowSymLinks 
  RewriteEngine On 
  RewriteRule ^.*$ test.php
  </code></pre>
  
  <p>So everything is redirected to test.php</p>
  
  <p>But it still doesn't work. So I checked my httpd.conf file under /etc/apache2. It is completely empty, with no lines of code (This seems a little odd to me)?! However checking in Stackoverflow answers there should be at least the following code in httpd.conf:</p>
  
  <pre><code>&lt;Directory /&gt;
      Options FollowSymLinks
      AllowOverride All
      Order deny,allow
      Deny from all
      Satisfy all
  &lt;/Directory&gt;
  </code></pre>
  
  <p>So I paste that code in httpd.conf. And restarted Apache with <code>sudo /etc/init.d/apache restart</code>. And it still does not work?</p>
  
  <p>I have also tested to open the file /sites-enabled/000-default and /sites-available/default, where all virtual host settings lies and change under the directory <code>/var/www</code> and <code>/</code> to AllowOverride All. The mod_rewrite still doesn't work. Can anyone please help me. This problem has been baking my nuts for a while. </p>
  
  <p>Also, my apache2.conf file doesn't work. I tried to write som nonsense. And it is still gives me the normal result instead of http 500 error</p>