API
에 .htaccess
파일로의 액세스를 시도하고 있는데 문제가 있습니다.HTAccess URL 다시 쓰기 규칙
예를 들어, 내가 달성하고 싶은 것은 :
사용자가
http://localhost/teammngr/user/photos/secrethash
에 도달 자동http://localhost/teammngr/user/photos.php?sid=secrethash
로 리디렉션됩니다.사용자는
http://localhost/teammngr/user/config/secrethash
에 도달하고 자동으로http://localhost/teammngr/user/config.php?sid=secrethash
으로 리디렉션됩니다.사용자가
http://localhost/teammngr/team/members/secrethash
에 도달하면 자동으로http://localhost/teammngr/team/members.php?sid=secrethash
으로 리디렉션됩니다.
사용자가이 파일을 직접보고 싶으면 가능할 것으로 예상됩니다. 또한 은 http://team.mywebsite.com/
과 같은 하위 도메인 아래에 있습니다.
.htaccess
파일을했습니다,하지만 내 서버에
500
오류를 던지고 유지합니다. 이 파일은 루트 디렉토리가 아니라 하위 디렉토리에 있습니다.
Options +FollowSymlinks
RewriteEngine On
RewriteBase /teammngr
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^user/([a-z_]+)/([A-Za-z0-9_-]+)$ /user/$1.php?sid=$2 [L]
RewriteRule ^team/([a-z_]+)/([A-Za-z0-9_-]+)$ /team/$1.php?sid=$2 [L]
어디에서 실수 했습니까?
귀하의 소중한 도움에 감사드립니다.
왜 당신이 할'RewriteBase/teammngr'합니다. 귀하의 URL에'teammngr'이 없습니다. – anubhava
@anubhava 당신이 그것을 나를 때려 라 하하 :) – Prix
죄송합니다, 나는 psot에서 실수를했습니다. 그걸 편집하겠습니다. – Manitoba