It is because you are missing rewrite rules .htaccess file, here is working solution tested:
in your project directory run, this will create .htaccess in project dir for you
sudo composer require symfony/apache-pack
then modify/add your virtual host directive in your apache virtual config file.
for Windows Xampp it is here -> C:\xampp\apache\conf\extra\httpd-vhosts.conf
for Linux default Ubuntu it is here -> /etc/apache2/sites-enabled/yoursite.conf
here is how it looks like on Windows Xampp
<VirtualHost 127.0.0.1:80>
DocumentRoot "C:\xampp\htdocs\final\public"
DirectoryIndex index.php
<Directory "C:\xampp\htdocs\project\public">
#AllowOverride All # for older version of apache less than 2.4
#Order Allow,Deny # for older version of apache less than 2.4
#All from All # for older version of apache less than 2.4
Require all granted
</Directory>
</VirtualHost>
here is how it looks like on Linux
<VirtualHost *:80>
ServerName company.com
DocumentRoot /var/www/company.com/web
<Directory /var/www/company.com/web>
Options Indexes FollowSymlinks
AllowOverride All
# Use these 2 lines for Apache 2.3 and below
##Order allow,deny
##allow from all
# Use this line for Apache 2.4 and above
Require all granted
</Directory>
ErrorLog /var/log/apache2/events_error.log
CustomLog /var/log/apache2/events_access.log combined
restart your apache
sudo service restart apache2
done, should just work!
source: https://www.youtube.com/watch?v=OVbErFBUinI