Hello!
Let's see if you can give me a hand :)
I am trying to modify the httaccess of my blog so that when they try to access through www it redirects to non-www and the fact is that I get it, but when it redirects to the home page it adds a double slash at the end, eg: https:// loquesea.com//
The fact is that with the other urls it doesn't happen to me and it's something that is making me a little desperate.
This is the rule I'm using:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.([^/]+)/$ [NC]
RewriteRule ^/(.*) https://%1/$1 [R=301,L]
With the regular expression I try to get only the loquesea.com part and I have tried doing it with code and it works perfectly so I don't know why it could be happening.
The web is made with Django, I don't know if it could be influencing something.
Thanks in advance!
Hello! With the solution that Carmen shared in the comments, I was able to solve it. The explanation of how to solve it is in this link: https://simonecarletti.com/blog/2016/08/redirect-domain-http-https-www -Apache/