1

my question is quite simple, but I could not find an answer on google.

In my silex project I have a parameter that can be or not on my url, e.g.:

domain.com/?foo=1

When I use the method before it works fine:

$app->before(function (Request $request) use ($app) {
 echo $app['request']->get('foo');
});

however if I have any variant of that url I can't catch it anymore. e.g.:

domain.com/contact?foo=1
domain.com/about?foo=1
domain.com/company?foo=1

...

I know, I could create a route for that.. But if I have 20, 30 different routers, it sounds insane for me change all of them.

Any help would be really appreciated. Cheers.

4

2 に答える 2

1

結局、問題は私のNGINXにありました。この行を変更しました

    location / {
            try_files $uri $uri/ /index.php;
    }

    location / {
            try_files $uri $uri/ /index.php?$args;
    }

このダミーの質問で申し訳ありません。

于 2013-07-19T09:06:29.207 に答える