How to Redirect www to non www on Nginx

I just moved from my shared hosting plan to cloud VPS on Contabo and found that the www version of my website is showing Welcome to Nginx! page. I installed Aapanel to manage and configure my website, it’s like CPANEL on shared hosting.

Here are the steps required to fix that problem:

  1. Login to Aapanel and click Website
www to non www

2. It will show your all websites, on the website you want to configure, click Conf

www to non www1

3. You will see below window (Domain Manager), add www.yourdomain.com, click Add

www to non www2

4. After adding you will see similar to the below window.

www to non www3

5. From the left menu click Redirect, click Add Redirection

www to non www4

6. Click Source and choose the www version of your domain, on target URL type https address of your version as below.

www to non www5

Click Submit and you are done.

Click on the browser to make sure that your www version of the website correctly redirect to non www version as this website. Thank you.

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *