Redirection loop

Now I'm getting a redirection loop between the www.example.com and the example.com domains and I can't figure out where the problem is.

Have you checked the DNS records in your domain registrar? There might be misconfiguration with CNAME and A records.