How to go back to referer after login failure?

I solved it. There is solution: How to disable redirection after login_check in Symfony 2 and here is code which solves my problem: <?php namespace Acme\MainBundle\Handler; use Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface; use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RedirectResponse; class AuthenticationHandler implements AuthenticationFailureHandlerInterface, LogoutSuccessHandlerInterface { public function onAuthenticationFailure(Request $request, AuthenticationException $exception) { $referer = $request->headers->get(‘referer’); $request->getSession()->setFlash(‘error’, $exception->getMessage()); return … Read more

What is the difference between redirect and navigation/forward and when to use what?

First of all, the term “redirect” is in web development world the action of sending the client an empty HTTP response with just a Location header with therein the new URL on which the client has to send a brand new GET request. So basically: Client sends a HTTP request to somepage.xhtml. Server sends a … Read more

Nginx Redirect HTTP to HTTPS and non-www to ww

The SSL redirect won’t work if your SSL certificate doesn’t support the non-www domain. The config is correct but can be reduced to just 1 redirect server Also don’t forget to reload Nginx sudo service nginx reload server { listen 80; listen 443 ssl; server_name example.com; # add ssl settings return 301 https://www.example.com$request_uri; }