문제

저는 PHP에 대한 새로운 정보입니다. 누구든지 각 줄이 여기서 무엇을하는지 말해 줄 수 있습니까? 이거 필요합니까? 그것은 나에게 오류를주고있다

RewriteCond %{REQUEST_URI} /~([^/]+)/?
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) /~%1/rewrite.php?p=$1&%{QUERY_STRING} [L]
RewriteCond %{REQUEST_URI} /~([^/]+)/?
RewriteRule ^index\.php?(.*)$ /~%1/rewrite.php?p=%1&%{QUERY_STRING} [L]
#there is no ~ character in the URL
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) ./rewrite.php?p=$1&%{QUERY_STRING} [L]
RewriteRule ^index\.php?(.*)$ ./rewrite.php?p=$1&%{QUERY_STRING} [L]
#WJ-180 fix
RewriteRule ^resume\.php?(.*)$ ./rewrite.php?p=resume\.php$1&%{QUERY_STRING} [L]
도움이 되었습니까?

해결책

간단한 답변 :이 선언은 모든 요청을 rewrite.php 파일.

더 포괄적 인 답변 : RewriteCond 그리고 RewriteRule 지시문은 Apache 모듈 mod_rewrite 규칙 기반 URL 재 작성 메커니즘을 제공합니다.

이 규칙은 모든 요청을 rewrite.php 특정 디렉토리에 파일 (파일) (/~foobar/rewrite.php) 또는 뿌리에 (/rewrite.php).

다른 팁

당신이 새로운 경우, 읽으십시오 http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html, 그것은 매우 멋지게 설명됩니다.

추신 귀하의 제목 "이러한 선언은 내 PHP .htaccess 파일에서 무엇을 의미합니까?" .htacces는 php 파일이 아닙니다.

이것들은 말한다

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

"요청이 기존 파일이나 디렉토리와 일치하지 않는 경우에만 다음 규칙을 사용하십시오."

사람들은 mod_rewrite 구성 항목.

그것은 Apache mod_rewrite 규칙입니다. 일종의 프레임 워크를 사용하지 않는 한 필요하지 않을 것입니다. 자세한 내용은 Apache Mod_rewrite를 참조하십시오.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top