hello family could help me convert this .htaccess to nginx:
RewriteEngine On
RewriteCond% {REQUEST_FILENAME}! -D
RewriteCond% {REQUEST_FILENAME}! -F
RewriteRule ^ admin /(.*)?$ admin / index.php? A = $ 1 [QSA, NC, L]
RewriteRule ^ sitemap.xml $ sitemap.php
RewriteCond% {REQUEST_FILENAME}! -D
RewriteCond% {REQUEST_FILENAME}! -F
RewriteRule ^ (. *)? $ Index.php? A = $ 1 [QSA, NC, L]
ErrorDocument 404 /index.php?a=404
I tried and gave me this result but it is not working:
error_page 404 /index.php?a=404;
location / {
if (! -e $ request_filename) {
rewrite ^ / admin /(.*)?$ /admin/index.php?a=$1 break;
}
if (! -e $ request_filename) {
rewrite ^ / (. *)? $ /index.php?a=$1 break;
}
}
location = /sitemap.xml {
rewrite ^ (. *) $ /sitemap.php;
}