Just to update, this code:
if (!-f $request_filename){
set $rule_0 1$rule_0;
}
if (!-d $request_filename){
set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
rewrite /. /index.php last;
}
if ($http_host ~* "^www.(.*)$"){
set $rule_1 1$rule_1;
set $bref_1 $1;
}
if ($rule_1 = "1"){
rewrite ^/(.*)$ http://$bref_1 permanent;
}
seemed to work when I eneterd it into the following file in /usr/local/nginx/conf/conf.d:
mydomain.com.conf
woohoo!
Rather than having to add this to every domain I add manually, how can I make it so it adds this code every time automatically?
Thank you for any help with this.