404 error - The requested URL /en/ was not found on this server.
MyLabBook opened this issue · 3 comments
Installed this demo on Ubuntu 18 using composer and am running it through apache2 instead of ./bin/console. If I have indexing turned on in apache and when I start from the root directory, I can see the app successfully at the public subdirectory. However, selecting any of the menu items, or setting the default directory in apache to use the public subdirectory, gives the following error.
The requested URL /en/ was not found on this server.
The /en/ is being appended to the URL by the /config/services.yaml file apparently, but that is causing the 404 error.
I have tried with and without running npm and yarn, with the same results.
OK. I found the solution. I did not have the Rewrite enabled in my apache config file. So I added the following.
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Now it works.
Thanks for your feedback. I never thought that someone would setup a VirtualHost for it.
Symfony has godd docuemntation about it as well (just dropping it here, if someone else searches for it in the future):
https://symfony.com/doc/current/setup/web_server_configuration.html