Hi,
I'll take the liberty of bringing up this subject again because I find myself with the same problem on Wordops. I can't redirect the no-wwww to www.
I created a redirect.conf file in /etc/nginx/conf.d/ including :
server {
server_name "~^(?!www\.).*";
return 301 $scheme://www.$host$request_uri;
}
But it doesn't work.
For the record:
When I create a site for Wordpress (with Redis cache) I launch the following command: wo site create www.domain.tld --wpredis
However Wordops create me the following directory: /var/www/domain.tld
and not /var/www/www.domaine.tld
as mentioned in the installation code.
When I execute the command "wo site edit domaine.tld" to configure the nginx file, I have the following code :
server {
server_name domain.tld www.domain.tld;
access_log /var/log/nginx/domain.tld.access.log rt_cache_redis;
error_log /var/log/nginx/domain.tld.error.log;
root /var/www/domain.tld/htdocs;
index index.php index.html index.htm;
include common/redis-php72.conf;
include common/wpcommon-php72.conf;
include common/locations-wo.conf;
include /var/www/domain.tld/conf/nginx/*.conf;
}
Can you help me? Thank you