저는 Cakephp 2.3을 사용하고 있습니다. 이전 페이지를 HTTP 301 상태의 새 페이지로 리디렉션하고 싶습니다. 이제 내 URL은 http://www.example.com/profile/john 및 http://www.example.com/profile/john/shop처럼CakePHP 2.3. - 리디렉션 301이 작동하지 않습니다.
내가 http://www.example.com/user/john 및 http://www.example.com/user/john/shop처럼 보이도록 URL을하고 싶습니다각각
내 routes.php는
Router::connect(
'/profile/:profile_name',
array(
'controller' => 'profile',
'action' => 'index',
),
array (
'pass' => array('profile_name')
)
);
Router::connect(
'/profile/:profile_name/shop',
array(
'controller' => 'profile',
'action' => 'shop'
),
array(
'pass' => array('profile_name')
)
);
내 리디렉션은 다음과 같습니다
Router::redirect(
'/user/:profile_name',
array(
'controller' => 'profile',
'action' => 'index',
),
array (
'persistent' => true,
'status' => 301
)
);
Router::redirect(
'/user/:profile_name/shop',
array(
'controller' => 'profile',
'action' => 'shop',
),
array (
'persistent' => true,
'status' => 301
)
);
그러나 그것은 작동하지 않습니다. 404 페이지가 아직도 내가이 튜토리얼하지만 아무것도에 설명 된대로 일을하려고했다
게재되어 작동
밤은 컨트롤러? – noslone
예, 프로필 - 대회라고해야합니다. 문제가 될 수 있습니까? – vlcik
그게 문제가 될 수 있는데,''controller '=>'profile''을''controller '=>'profiles''로 변경하면 시도해 볼 수 있습니다. – noslone