Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

redirect multiple sites with www to the same domains without www

$
0
0
I want to make a server block, or location block (not sure which works) using regex to redirect all domains with www to the same without www.

something in this lines:

server_name ~^(www\.)?(?<domain>.+)$;
rewrite ^ http://$domain$request_uri? permanent;

Any help would be great

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>