Find the file with name ‘apache2.config.’ Open it in ‘root’ mode.
Now find these line:
Options Indexes FollowSymLinks
Require all granted
Only you have to do a single things to solve your URL problem.
Change AllowOverride None to Change AllowOverride ALL
Save and close your file.
There have one more steep to do. Open your terminal and run both command
sudo a2enmod rewrite
sudo service apache2 restart