I'm shutting down a site and I need to 301 redirect all pages to the home page where I have a message saying that the site is being closed down.
Basically any http://example.com/anyfolder -> 301 to http://www.example.com
I have the following but this results in a redirection loop.
location ~ ^/([A-z]+) { rewrite ^ / permanent; }
What is the proper way to do this in nginx?