I normally work exclusively in frontend_dev.php mode while working on symfony apps. But on occasion I’ll switch over to the index.php production mode. When I switched, my entire app failed. Miserably. I would use a known URL such as example.com/categories/5/tech-stuff and I would get a Not Found error in return.
I thought at first that this problem was an htaccess issue. So I headed over to /web/.htaccess. The docs in the file specifically say that if no_name_script doesn’t work, try the following line.
# uncomment the following line, if you are having trouble
# getting no_script_name to work
That didn’t solve the problem. I still received lovely not found errors. Those errors were not appearing when I used the front_end development mode, so it was something else. I had recently reinstalled my server and I wondered if that had something to do with it. I went to take a look at what extensions apache2 on Ubuntu was automatically installed with.
The big surprise: mod_rewrite was not enabled automatically! So after enabling it quickly with
sudo a2enmod rewrite and restarting apache2 with the change
sudo service apache2 restart