Good day, on my site users, can create usernames for their profiles but every time they try to visit their usernames on the browser to shows a 404 page, and on top of that it does not show the defined 404 while at it. For example;
domain.com/username DOES NOT LOAD
domain.com/@username LOADS PROPERLY (and if the username does not exist it shows defined 404.)
Below is the snippet of the block;
if (!-e $request_filename){
rewrite ^/password-reset/([^\/]+)(\/|)$ /index.php?link1=welcome&link2=password_reset&user_id=$1;
}
rewrite ^/$ /index.php?link1=home;
rewrite "^/forum/members/([a-zA-Z]{0,1})(/?|)$" /index.php?link1=forum-members-byname&char=$1;
if (!-e $request_filename){
rewrite ^/setting/([A-Za-z0-9_]+)/([A-Za-z0-9_-]+)$ /index.php?link1=setting&user=$1&page=$2;
rewrite ^/setting/([A-Za-z0-9_-]+)$ /index.php?link1=setting&page=$1;
rewrite ^/setting$ /index.php?link1=setting;
}
if (!-e $request_filename){
rewrite ^/@([^\/]+)(\/|)$ /index.php?link1=timeline&u=$1;
}
if (!-e $request_filename){
rewrite ^/([A-Za-z0-9_]+)/([^\/]+)(\/|)$ /index.php?link1=timeline&u=$1&type=$2;
}
if (!-e $request_filename){
rewrite ^/([^\/]+)(\/|)$ /index.php?link1=timeline&u=$1;
}
}
location /nodejs {
deny all;
}```