mod_rewrite라는 것은 URL을 관리하는 모듈입니다. CakePHP를 사용함에 있어서 mod_rewrite모듈은 필수는 아닙니다.
mod_rewrite 모듈을 사용하지 않는경우 cakephp 에 접속할때 URL이 길어진다던가 하는 몇가지의 불편한 점이 있습니다.
특별한 이유가 없는경우 mod_rewrite 모듈을 사용하게 해주면 편리 합니다.
Apache를Web서버로 사용하고 있는경우「http.conf」파일을 편집 합니다.
http.conf 파일은 자신의 apache 폴더 안에 conf 폴더 안에 있습니다.
우선 http.conf 파일 내에서「LoadModule rewrite_module modules/mod_rewrite.so」검색 합니다.
아래와 같이 되어 있습니다.
#는 주석 이므로 사용하기 위해 #를 삭제 합니다.
#LoadModule rewrite_module modules/mod_rewrite.so -> LoadModule rewrite_module modules/mod_rewrite.so
다음은 「.htaccess」파일을 사용할 수 있게 설정합니다.「CakePHP」를 설정한 디렉토리에 대해서「AllowOverride」을「All」로 설정 합니다. 이번에는 아래의 설정을 「http.conf」파일의 제일 및에 추가 합니다.
<Directory "D:/Apache Group/Apache2.2/htdocs/cake">
AllowOverride All
</Directory>
설정을 변경해 주어도 동일한 결과를 볼 수 있습니다.

댓글목록
등록된 댓글이 없습니다.