php rest api만들기위한 .htaccess 설정질문드립니다 채택완료
안녕하세요..
php rest api만들기위한 .htaccess 설정질문드립니다
경로는 루트 App/test.php로 만들었습니다
2128.19, "DOW"=>18150.44, "NASDAQ"=>5194.41 ); if(isset($database[$index])) responseJSON(200,"Success",$index,$database[$index]); else responseJSON(200,"Not Found",$index,""); function responseJSON($status, $msg, $index, $value){ header("Content-type:application/json"); header("HTTP/1.1 $status $msg"); $resp['index'] = $index; $resp['value'] = $value; echo json_encode($resp); } ?>
.htaccess 설정은
RewriteEngine On RewriteRule ^rest/(.*)$ test.php?data=$1
이렇게적어주었는데요..
둘다 해봐도 The requested URL /App/DOW was not found on this server. 이런 에러가 뜹니다.

이렇게 나와야하는데..저는 왜안될까요??? 호스팅 카페24쓰고있습니다
http://도메인/DOW 이런식으로 검색햇을떄
json형태로 나오게하려면 서버에서 따로 설정을 해주어야하는것인가요?
http://도메인/test.php 를검색해서 json형태를 찾는게아닌
http://도메인/DOW(dow 변수이름또는 함수명) 을 서버에서 검색해서 찾아서 json형태로 출력되길원합니다
도움좀부탁드립니다.
답변 1개
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인