본문 바로가기

프로그래밍/웹

localhost:8080 대신 직접 도메인 지정하기

쿠키를 보낼때 등 직접도메인을 지정해서 보내야하는 경우가 있다.

이때 도메인 셋팅은c:\windows\system32\drivers\etc\hosts 파일을 메모장이나 에딧플러스 따위로열면

이런식으로 적혀있는데,

# localhost name resolution is handled within DNS itself.

# 127.0.0.1       localhost

# ::1             localhost


이와같이 주석처리되있는곳 아래정도에 모르겠음 아무라인이나상관없음.

127.0.0.1     test.test.com 

이런식으로 한줄을 넣어주면된다.

그럼 localhost:8080/exproject/test.jsp 도 물론사용가능하고

test.test.com:8080/exproject/test.jsp 이렇게도 대신할수있다.