내 웹 사이트에서 URL 재 작성을 사용하고 있는데 .htpasswd 파일을 통해 내 디렉토리 중 하나에 인증을 추가하고 싶습니다.URL 재 작성 및 htpasswd
http//website/directory1/protected/test.php
당신 것 같은
RewriteRule ^directory([0-9]+)/protected/([a-z0-9-_]+).php /home/website/protected/admin.php?d=$1&p=$2 [QSA]
URL을 사용 :
내 웹 사이트 내가 .htaccess 파일을 가지고/홈/웹 사이트/디렉토리에 그
/home/website/
/home/website/protected/
/home/website/protected/.htaccess
/home/website/protected/.htpasswd
/home/website/protected/admin.php
/home/website/.htaccess
/home/website/index.php
/home/website/index_protected.php
처럼 구축이다 전화
/home/website/1/protected/admin.php?d=1&p=test
내가 가진/보호/디렉토리의 .htaccess에
:
AuthName "Page d'administration protégée"
AuthType Basic
AuthUserFile "/home/website/protected/.htpasswd"
Require valid-user
그리고 내가 가진/보호/디렉토리에서 .htpasswd에
:admin:crypted_password
하지만 내 문제는 내가 호출 할 때이다
http//website/directory1/protected/test.php
나는 인증 창을 전혀 가지고 있지 않다.
아마 이해할 수 없지만 내/protected/디렉토리에 이미 "기본 인증"지침이있는 .htaccess 파일이 있습니다 – Natha
물론 미안합니다. 물론 질문에 답을 얻었습니다. –
Np, 도와 줘서 고마워. – Natha