How to Convert .htaccess Rules to NGINX Directives

In this video, we demonstrate how to convert .htaccess rules to Nginx directives.

Commands used:
rewrite regex URL [flag];

RewriteCond %{HTTP_HOST}
RewriteRule (.*)$1

nginx -t
nginx -s reload

RewriteEngine On
RewriteCond %{HTTP_HOST} ^ [NC] RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$$1 [R,L]

The full article for this video can be found here:

For more information about this and other topics, visit us at or for more information on our VPS product line, visit:

Video by: Justin Palmer

Duration: 00:02:46
Publisher: Liquid Web
You can watch this video also at the source.