현재 Mod 재 작성을 사용하여 PHP에서 URL을 수정하는 방법을 연구 중입니다.여러 값이 URL에 전달 될 때 PHP에서 URL 재 작성
일반적인 URL은 다음과 같이 수 :
http://www.fitness.com/find_a_pt/?county=&constituency=211&gender=&action=search
을 이제 만 유권자가 선택 위의 예에서. 카운티 또는 성별이 지정되지 않았습니다.
위의 구성 원은 '다트 포드'를 의미합니다. - URL에 따라
이상 선택하지 않음1) :
http://www.fitness.com/find_a_pt/dartford
지금 추가 합병증은 성별이 될 수 있다는 것이다 : URL이 읽으면
그래서 그것은 좋은 것입니다2) 남성
http://www.ego3fitness.com/find_a_pt/?county=&constituency=211&gender=1&action=search
012 3,516,3) 여성
http://www.ego3fitness.com/find_a_pt/?county=&constituency=211&gender=&actiom=search
그래서 URL을 읽을 필요가있다 :
1) http://www.fitness.com/find_a_pt/dartford/female
은 첫째가 http://www.fitness.com/find_a_pt/dartford
2) http://www.fitness.com/find_a_pt/dartford/male
3)이다 이 특정 일 수 있음 URL을 다시 쓰면 누군가가 나를 일하는 예제를 제공 할 수 있습니다.
미리 도움을 주셔서 감사합니다. 이와
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
의 index.php에 forwared 모든 것을 규칙 :