Symfony 3:使用引荐来源网址重定向到登录

Symfony 3: Redirect to Login with Referer

我在access_control下的security.yml上有此标签:

- { path: ^/somepath/, roles: IS_AUTHENTICATED_FULLY, requires_channel: https}

每当我尝试使用浏览器的地址栏手动进入/somepath/someotherpath时,它都会将我重定向到登录页面。问题是$request->server->get('HTTP_REFERER')为空。

我做错了吗,还是只是手动键入安全的URL不会有HTTP_REFERER?


Wikpiedia:

When visiting a webpage, the referrer or referring page is the URL of the previous webpage from which a link was followed.

如果您手动键入url,则不会在任何前一页上关注任何链接,因此没有引荐来源。