item.url generated at menu issue I am working on my client's project and they are using Drupal 8.
I discovered that when one uses http://example.com/index.php to access the webpage, the url generated by the menu items , the index.php part is included, i.e. http://example.com/index.php/aboutus instead of http://example.com/aboutus. And it leads to a wrong page.
And I checked with the template file which generates the menu, the url of the menu is generated by {{item.url}}, which item is one single item of items for the available variables in the menu templates.

Available variables:
-menu_name: The machine name of the menu.
-items: A nested list of menu items. Each menu item contains:
-attributes: HTML attributes for the menu item.
-below: The menu item child items.
-title: The menu link title.
-url: The menu link url, instance of \Drupal\Core\Url
-localized_options: Menu link localized options.

Therefore I am asking if there are ways to get rid of the &quot;index.php&quot; in this case and in order to avoid drupal generating wrong url? Thank you very much
I think you may need to enable apache mod_rewrite. You can refer this answer as well. To enable mod_rewrite, use the following command:

a2enmod rewrite


Then you need to restart apache for the changes to reflect,

sudo /etc/init.d/apache2 restart


or

sudo service apache2 restart


Refer this page for information about clean urls, this might even help.