How can I use an .htaccess file in Nginx?

I am currently migrating my website from Apache to nginx, but my .htaccess file is not working. My website is inside the /usr/share/nginx/html/mywebsite folder. How can I use .htaccess in my nginx server?

This is my .htaccess file:

RewriteEngine on
RewriteRule video/watch/([a-zA-Z0-9_@$*-]+)/?$ "videos-single.php?id=$1" [NC]

Leave a Comment