I am trying to move my server to Nginx for trial purposes. However, when I transfer my htaccess codes to conf file, I get 404 error. How can I make the codes below Nginx rewrite compatible?
RewriteEngine on
RewriteRule ^firmaekle\.html$ /firmaekle.php [L,QSA,R=301]
RewriteRule ^/d/([^/]*).([^/]*)\.html$ /index.php?site=$1&site2=$2 [L,QSA,R=301]
RewriteRule ^u/([^/]*)([^/]*)\.html$ /uzgun.php?site=$1&site2=$2 [L,QSA,R=301]
RewriteRule ^y/([^/]*)([^/]*)\.html$ /yonlendir.php?firma=$1&uzanti=$2 [L,QSA,R=301]
RewriteRule ^ye/([^/]*)([^/]*)\.html$ /yonlendir2.php?firma=$1&uzanti=$2 [L,QSA,R=301]
you can do it like this
server {
server_name example.com;
rewrite ^/firmaekle\.html$ /firmaekle.php permanent;
rewrite ^//d/([^/]*).([^/]*)\.html$ /index.php?site=$1&site2=$2 permanent;
rewrite ^/u/([^/]*)([^/]*)\.html$ /uzgun.php?site=$1&site2=$2 permanent;
rewrite ^/y/([^/]*)([^/]*)\.html$ /yonlendir.php?firma=$1&uzanti=$2 permanent;
rewrite ^/ye/([^/]*)([^/]*)\.html$ /yonlendir2.php?firma=$1&uzanti=$2 permanent;
}