Cover by Dipankar Sarkar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

Converting your Apache's .htaccess into Nginx rewrites

One of the primary uses of Nginx rewrites is to help you easily translate Apache2's .htaccess to usable Nginx configuration. Apache2 is the dominant open source web server in the world. In such a situation, inevitably most of the code available has .htaccess rules and very little direction regarding how to go about configuring Nginx rewrites so that it can properly run the site.

How to do it...

In this we will have a look at an example where we take an .htaccess file and see its equivalent Nginx rewrite rules. In the later sections, we will have a look at some patterns that emerge out of the conversion which you can later utilize for converting other scripts.

Options -Indexes Options +FollowSymLinks ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required