I tried to redirect the Wordpress website using .htaccess, but it causes an infinite loop to form. Now there is no redirect for the blog. However, the domain URL with www is automatically redirected to non-www. I checked the whole server and I am sure there is no redirect on the server. I also tried to change the site address and the Wordpress address in the control panel, but it still creates an endless loop.
There is nothing redirecting in the template because I tried to create a simple test .html file and still the same.
Note. I don’t think the code matters here, because the question is where this WWW was redirected not to www, which I didn’t indicate in my code or on the server
RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
update: I just found out about it. Plesk configuration files are really complex, distributed in many places. I see that the rewrite rule has been added to conf conf inside the website name. I deleted this and changed the site url and now everything is working fine. Thank you for your support.
source
share