Hi @kocaeli,
Depending on the Web Service you are using - Apache or Nginx the redirection rules are configured differently.
Nginx
If you are using Nginx, you’ll need to add the following block of code in your site’s Nginx configuration
server {
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
}
DigitalOcean has a pretty good article on how to do that here - https://www.digitalocean.com/community/tutorials/how-to-redirect-www-to-non-www-with-nginx-on-centos-7
Apache
If you are using Apache, the redirection would need to be done in an .htaccess file located in your website’s directory.
You can add the following to the .htaccess file in order for the redirection to work
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
That’s it, you now have examples for both WebServices and you should be good to go!
Regards,
KDSys

by Mitchell Anicas
This tutorial will show you how to redirect a www URL to non-www, e.g. `www.example.com` to `example.com`, with Nginx on CentOS 7. We will also show you how to redirect in the other direction, from a non-www URL to www.
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot “/path/to/port/80/site”
</VirtualHost>
<VirtualHost *:443>
ServerName example.com
ServerAlias www.example.com
DocumentRoot “/path/to/port/443/site”
</VirtualHos