How to Convert .htaccess Rules to NGINX Directives

Your video will begin in 10
63 Views
Published
In this video, we demonstrate how to convert .htaccess rules to NGINX directives.

Commands used:
rewrite regex URL [flag];

RewriteCond %{HTTP_HOST} example.com
RewriteRule (.*)https://www.example.com$1

nginx -t
nginx -s reload

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com [NC] RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]

The full article for this video can be found here: https://www.liquidweb.com/kb/convert-htaccess-rules-nginx-directives/

For more information about this and other topics, visit us at https://www.liquidweb.com/kb/ or for more information on our VPS product line, visit: https://www.liquidweb.com/products/vps/.

Video by: Justin Palmer
Category
Liquid Web
Tags
liquidweb, datacenter, web
Be the first to comment