0

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;
}```
Henry
  • 1
  • 1
  • **I trailed the the error and got this;** ```2021/12/14 22:06:13 [error] 92611#92611: *92140 open() "/var/www/website/username" failed (2: No such file or directory), client: 123.321.213.312, server: domain.com, request: "GET /username HTTP/1.1", host: "domain.com"``` – Henry Dec 14 '21 at 22:26

0 Answers0