Documentation / Tutorials / Server

Creating 301 redirects in Nginx server

/ Server / Creating 301 redirects in Nginx server

This tutorial assumes that your web server was setup using easyengine.

  1. Create the redirects.conf file within /var/www/example.com/conf/nginx folder.
  2. Write your redirect rules in the file created above, an example
    location /wp-content/uploads/2015/08/BannerContent-Onboarding.docx {
        return 301 https://example.com/onboarding/;
    }

     

  3. Save the file and on command line type, the command below to test the configuration file.
     nginx -t

     

  4. Finally, load the configurations for the nginx server using
    service nginx reload

     

 

Categories
Most Popular

Leave a Reply

Your email address will not be published. Required fields are marked *