Redirect Question for Directory Structure Change

figshta nginx-forum at
Wed Sep 9 15:11:53 UTC 2020

I'm looking for help with a permanent site-wide redirect.

I have a website that I moved to a new server. 
For some crazy reason the old server had an odd structure that I am
The URL root  for the old site is
I have changed it to be

Example: --- redirects to ---->

There are many other folders and html files that need this site-wide

Of course anyone can access the site when linking to the root, but there are
many links out there referring to the old directory structure under /e/.
I'm looking for assistance writing a redirect so all those inbound links out
there on the internet work again.

I tried a couple of ideas, but they didn't work,
I thought this location directive inside a server block was best, but it
didn't work. 

location = /e {
       return 310 $scheme://;

Any help would be greatly appreciated.

Posted at Nginx Forum:,289363,289363#msg-289363

More information about the nginx mailing list