- Edited
Following redirection tutorial will result into:
http://europewebhosting.co > https://www.europewebhosting.co
http://www.europewebhosting.co > https://www.europewebhosting.co
https://europewebhosting.co > https://www.europewebhosting.co
http://europewebhosting.co > https://www.europewebhosting.co
http://europewebhosting.co > https://www.europewebhosting.co
You can redir php site created with WordOps from non-www to www version when you:
In /etc/nginx/sites-available/europewebhosting.co
remove non-www version from server_name
(leave www.europewebhosting.co
, remove europewebhosting.co
).
In /etc/nginx/conf.d/force-ssl-europewebhosting.co.conf
edit file like:
server {
listen 80;
listen [::]:80;
server_name europewebhosting.co www.europewebhosting.co;
return 301 https://www.europewebhosting.co$request_uri;
}
Create new file nano /etc/nginx/conf.d/force-ssl-europewebhosting.co-redir.conf
like:
server {
server_name europewebhosting.co;
include /var/www/europewebhosting.co/conf/nginx/ssl.conf;
return 301 https://www.europewebhosting.co$request_uri;
}
Restart server:
nginx -t
service nginx restart
That's it!
[source]