P
P
Peter2013-11-14 22:10:32
PHP
Peter, 2013-11-14 22:10:32

Silex - opens only index. Why?

I am doing the first deployment of the project on Silex.

All loaded. Access to a DB configured. Errors won, index is displayed.

But I ran into the following problem: Other pages do not open, only index.

An example of a problematic controller:

$app->match('/add/{flat_id}', function (Request $request, $flat_id) use ($app) {
 ... 
})
->bind('add')

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
maximw, 2013-11-14
@Alcospb

I would first look at the web server settings. For example, you have Apache locally with .htaccess, and Nginx on the server.

D
d1mk0, 2015-04-22
@d1mk0

If you have Apache, put a .htaccess file in the folder with the index file with something like this

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question