title: How to remove index.php from Symfony4 router?
body: <p>I have been following Symfony 4 documentation as to how to configure a web server.</p>
  
  <p><a href="https://symfony.com/doc/current/setup/web_server_configuration.html" rel="noreferrer">https://symfony.com/doc/current/setup/web_server_configuration.html</a></p>
  
  <p>My .conf file in my apache 2.4 configuration is exactly as described in their documentation. I’m copying part of it here :</p>
  
  <pre><code>&lt;Directory /var/www/project/public&gt;
      AllowOverride None
      Require all granted
      Allow from All
  
      &lt;IfModule mod_rewrite.c&gt;
          Options -MultiViews
          RewriteEngine On
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteRule ^(.*)$ index.php [QSA,L]
      &lt;/IfModule&gt;
  &lt;/Directory&gt;
  </code></pre>
  
  <p>Going to my platform, everything works fine but as soon as I’m going to any page, it shows a 404 error. If I add index.php in the url it works fine. Could you help me figure out what is going on?</p>
  
  <p>For example:
  When I’m on <a href="http://myplatform.com/" rel="noreferrer">http://myplatform.com/</a></p>
  
  <p>I can save an email address on this page. If I go to <a href="http://myplatform.com/index.php/saveEmail" rel="noreferrer">http://myplatform.com/index.php/saveEmail</a> it works, but from my page, my links redirects me to <a href="http://myplatform.com/saveEmail" rel="noreferrer">http://myplatform.com/saveEmail</a> and it doesn’t work.</p>
  
  <p>If i go to <a href="http://myplatform.com/index.php" rel="noreferrer">http://myplatform.com/index.php</a> then everything works fine.</p>
  
  <p>How to I remove index.php from the url ?</p>
  
  <p>Thanks!</p>