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]
Nginx doesn't support .htaccess
(see here: "You can’t do this. You shouldn’t. If you need .htaccess, you’re probably doing it wrong.").
You've two choices (as I know):
.htaccess
to nginx.conf
(maybe the htaccess to nginx converter helps you)