Servlet filter runs in infinite redirect loop when user is not logged in

This AuthenticationFilter also runs when login.html is being requested. However, the code is redirecting to login.html once again instead of continuing the filter chain. This explains the infinite redirect loop. You need to let the filter just continue the request if the currently requested page is already the login page itself. E.g. public void doFilter(ServletRequest … Read more

.htaccess rewrite “/book.php?id=1234” to “/book/1234”

Your RewriteRule as written appears to be trying to do opposite of what your question headline is saying. You say that you want htaccess rewrite /book.php?id=1234 to /book/1234, but your RewriteRule: RewriteRule ^(.*)$ /book.php?url=$1 [L] Is adding a query string parameter. The RewriteRule below will rewrite rewrite /book.php?id=1234 to /book/1234 RewriteCond %{QUERY_STRING} ^id=([0-9]*)$ RewriteRule ^book\.php$ … Read more