Question
Redirecting www to nonwww version on ServerPilot
Hi,
I am totally new to having my own server. So please bear with me if my questions are too simple for some of you.
I used ServerPilot to set everything up. Everything works great, but my www version doesn’t redirect to non www.
I have this code in my .htaccess file (which worked perfectly on shared hosting before - I assume because they were using Apache):
RewriteCond %{HTTP_HOST} ^www.example.com.se$ [NC]
RewriteRule ^(.*)$ http://example.com.se/$1 [R=301,L]
Now, my research shows that serverpilot uses nginx and that the above code doesn’t work for nginx. But then I read a guide on serverpilot that says they use nginx along with apache and that the htaccess code should work. But it is not working currently.
So I am very confused. I would appreciate any help on how to achieve this.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×