Nginx routing rule rewriting

the current environment is that index.php is used as the entry file in the php+nginx,php site directory, and the current route rewriting rule is:

location / {
  if (!-e $request_filename) {
    rewrite   ^(.*)$ /index.php?s=$1 last;
    break;
  }
}

now, the current domain name http://a.com accesses the website normally. Now I want http://a.com/test/ to access the website. How can I change it? The "/ test/" address field is not specified in the
code, but is intended to be rewritten on url.

Dec.23,2021

Thank you for the invitation.

although I have not done this requirement, I think we can try it with alias , for example:

rewrite   ^test/(.*)$ /index.php?s=$1 last
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e44a2f-44ac7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e44a2f-44ac7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?