티스토리 뷰

apache 에서 404 오류가 날때 특정 페이지를 만들어 그 페이지를 띄워주는 방법
 
1. httpd.conf 수정
 
ErrorDocument 500 "The server made a boo boo."
ErrorDocument 404 /missing.html
ErrorDocument 404 "/cgi-bin/missing_handler.pl"
ErrorDocument 402 http://www.sample.com/404ErrorPage.html
 
2. .htaccess 설정
해당 홈페이지의 디렉토리로 이동하여 디렉토리 안에 .htaccess 파일에
 
ErrorDocument 500 "The server made a boo boo."
ErrorDocument 404 /missing.html
ErrorDocument 404 "/cgi-bin/missing_handler.pl"
ErrorDocument 402 http://www.sample.com/404ErrorPage.html
 
내용을 추가해주면 해당 홈페이지에만 적용이 된다.
 
.htaccess 를 사용하려면 httpd.conf 파일에서 내용을 수정해주어야 한다.
 
AccessOverride FileInfo 라고 되어 있어야 사용 가능 none 이면 사용 불가 

Total
Today
Yesterday
최근에 올라온 글
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31