내 codeigniter 사이트에서 위치 페이지를 만들고 싶습니다. 그래서 위치와 인덱스 메소드라는 하나의 컨트롤러가 있습니다. 그래서 모든 요청 http://mysite.com/location_name은 http://mysite.com/index.php/locations/index에 착륙해야합니다. http://mysite.com/login처럼 나머지는 모두 http://mysite.com/index.php/home/login으로 착륙해야합니다. 연락처 http://mysite.com/contact-us은 http://mysite.com/index.php/home/contact으로 착륙해야합니다. codeigniter의 리디렉션 규칙
나는 다음 행 노선 규칙 (route.php)를 작성하여이를 달성하기 위해 노력 :$route['(:any)'] = 'locations'; //location name can be anything around the world
위치가 잘 작동되도록하지만, http://mysite.com/login 및 http://mysite.com/contact-us들이 무한 루프에 지속적으로 리디렉션 작동하지 않습니다.
해결 방법을 제안하십시오. 감사.
경로는 외관 순서에 따라 다르다는 것을 기억하십시오.'(: any)' –
@ eric.itzhak, 감사하기 전에 login과 contact-us 로직을 설정해야합니다. 감사합니다. 그러나 나는 이미 그 명령을 가지고 노력했다. 나는 집에 대한 규칙을 작성하고, 로그인하고, 우리에게 먼저 연락한다. 그리고 마지막으로. 여전히 문제에 직면 해 있습니다. –