나는 그것이 example.com/u/User에서 현재의로, 루트 디렉토리에 사용자 프로필을 꿔, 나는 루트 사용자 디렉토리의 사용자 정의 URL?
그래서 내가 만든이 구성을 example.com/User을 꿔 :location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}
location @try-user {
rewrite ^(.*)$ /profile.php?user=$1;
}
location/{
try_files $uri $uri.html $uri/ @extensionless-php @try-user;
# To do: try-page
index index.html index.htm index.php;
expires 1h;
rewrite ^/messages/(.*)$ /messaging.php?u=$1;
}
해당 설정이있는 페이지로 이동할 때마다 @ try-user로 이동하고 사용자 이름 (example.com/Phil)을 입력하면 "사용자를 찾을 수 없음"이 표시됩니다.
아무도 도와 줄 수 있습니까?
'try_files' 문에 두 개의 명명 된 위치를 사용할 수 없습니다. [이 문서] (http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files)를 참조하십시오. 달성하고자하는 URI는'/profile.php? user =/Phil' 또는'/profile.php? user = Phil'입니까? –
/profile.php?user=Phil – Phil