How to 301 redirect in nginx

Search another help topic

To 301 redirect one folder to another use the following rewrite rule:

rewrite ^/example/(.*)$ /example1/$1 permanent;

Swapping example and example1 with your folders.

After updating restart nginx:

service nginx restart

Need help with this?

Open a ticket and link to this guide so our team can see what you have tried.

View support tickets

Power your business with Ecenica Hosting

Built for WordPress and serious websites. Fast, secure and supported by real people in the UK.

Ecenica hosting services represented by a connected red route across London