Skip to content
Advertisement

Heroku silex route show 404 except “/”

This piece of code was from an example at heroku. But except the route /, anything else I add does not work. It shows 404:

The requested URL /e was not found on this server.

JavaScript

Edit 1 I deployed it directly on heroku server (heroku auto build on each push to master branch)

Edit 2 my workspace:

JavaScript

The content of apache_app.conf is copied from this link. RewriteEngine On

JavaScript

I figured that I need to change the apache config somehow, but I don’t understand htaccess syntax.

Advertisement

Answer

For apache2, you can add a .htaccess file within “/web”

JavaScript

and set your Procfile as:

JavaScript

For nginx, create a nginx conf file with content:

JavaScript

and set Procfile as:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement