2012-11-24 2 views
1

cakePHP를 사용하고 있습니다. 다음 조건에 대한 다시 쓰기 규칙은 어떻게 작성합니까?정적 페이지의 cakePHP URL 다시 쓰기 규칙

http://www.example.com/pages/about_us 

http://www.example.com/about 

및 contact_us 및 다른 페이지와 유사합니다.

Redirect 301 /about_us http://www.example.com/about 

답변

2

응용 프로그램/구성/routes.php

라우터 : ('/ 약'을 연결 배열 ('컨트롤러'=> '페이지 :

+0

예, 작동 중입니다. 감사합니다. – chella

0

당신은 301과 같이 재 사용할 수 있습니다 ','action '=>'display ','about_us '));

+0

답장을 보내 주셔서 감사 드리며, 시도했지만 작동하지 않습니다. : – chella

+0

301 이전에 "RewriteEngine on"(따옴표 제외)을 지정했거나 규칙을 다시 작성 했습니까? – ReLeaf

+0

예. 내 .htaccess 파일입니다. RewriteEngine on RedirectMatch temp ^/blog/wp-admin $ http : //www.example .com/blog/wp-admin/ RewriteRule 블로그 $/blog/[L] RewriteRule 블로그/wp-admin $/블로그/wp-admin/[L] RewriteRule^$ app/webroot/[L] RewriteRule (. *) app/webroot/$ 1 [L] – chella