Index file
DATE : 2023/10/26
[ Index file ]
์์์ ์ดํด๋ณธ ์ํฉ์ ์ ๋ฆฌํด๋ณด๋ฉด
protocol://hostname:port/file_path
protocol://hostname/file_path
์ ๊ฐ์ด port๊ฐ ๋ช ์๋ ๊ฒฝ์ฐ, ์๋ ๊ฒฝ์ฐ๋ก ๋๋ ์ ์๋ ๋ฐ
์ด๋ฒ์ ์ดํด๋ณผ ๋ด์ฉ์ file path๊ฐ ๋ช ์๋์ง ์์ ๊ฒฝ์ฐ์ด๋ค.
http://192.168.183.129:1018/๋ง์ฝ์ ์ด์ ๊ฐ์ด file path๋ฅผ ์๋ตํ ์ํ๋ก URL์ ์ ๋ ฅํ๋ฉด ์ด๋ค ๊ฒฐ๊ณผ๊ฐ ๋์ค๊ฒ ๋ ๊น??

๊ฒฐ๊ณผ ํ๋ฉด์ ๋ณด๋ฉด ํ์ฌ ๊ฒฝ๋ก์ ์ด๋ค directory์ ํ์ผ์ด ๋ค์ด์๋ ์ง๋ฅผ ๋ณด์ฌ์ฃผ๊ณ ์๋ค.
[+] ์ด๋ directory listing ์ทจ์ฝ์ ์ผ๋ก ์ ์ฉ๋ ์ ์์!
ํ์ง๋ง Browser์ naver, google ์ ์ ๋ ฅํด๋ณด๋ฉด ํ์ด์ง๊ฐ ์ถ๋ ฅ ๋๋๋ฐ??
์ด๊ฒ ์ด๋ป๊ฒ ๋ ์ผ์ด๋!! ํ๋ฉด
์ ๋ ฅํ URL์ file path ๋ถ๋ถ์ด ๋น์ด์์ ๊ฒฝ์ฐ,
ํ์ผ์ ์์ฒญํ directory์ index file์ด ์กด์ฌํ๋ค๋ฉด ๊ทธ ํ์ผ์ด ๋ณด๋ด์ฃผ๋ ๊ฒ์ด๋ค.

๊ทธ๋์ naver๋ฅผ ์ ๋ ฅํ๊ณ ๋ค์ด๊ฐ์ ๋ ๋ณด์ด๋ ํ์ด์ง์

๋์ผํ ๊ฒฝ๋ก์ index.html์ ์์ฒญํ ๊ฒฐ๊ณผ ํ์ด์ง๊ฐ ๊ฐ์ ๊ฑธ ํ์ธํ ์ ์๋ค.
๊ฒฐ๋ก ์ ์ผ๋ก Index file์
file path๋ฅผ ๋ช ์ํ์ง ์์ ๊ฒฝ์ฐ ์ ๊ณต๋๋ ํ์ด์ง์ธ ์ ์ด๋ค.
๋ค๋ฅธ ๋ง๋ก file path๋ฅผ ์ ๋ ฅํ์ง ์์ ์์ฒญ์ ๋ณด๋ด๋ ๊ฑด index file์ ๋ฌ๋ผ๋ ์์ฒญ๊ณผ ๊ฐ๋ค!
(๋ค๋ง ์์์ ๋ดค๋ฏ์ด index file์ด ์กด์ฌํ ๋๋ง index file์ด ์ ๊ณต ๋๋ค๋ ์ !)
์ถ๊ฐ์ ์ผ๋ก ํ ๊ฐ์ง ๋ ์ดํด๋ณด์๋ฉด
index file์ web root ๊ฒฝ๋ก ๋ฟ๋ง ์๋๋ผ ๊ฐ directory๋ง๋ค ์ ์ฉ๋๋ค.

webApp directory(ํ์ฌ web root ๊ฒฝ๋ก)์ index.html์ ๋ง๋ค์ด์ฃผ๊ณ
์์์ ์ฌ์ฉํ๋ URL์ ๋ค์ ํ ๋ฒ ์ ๋ ฅํด๋ณด๋ฉด

index.html ๋ด์ฉ์ ํ์ธํ ์ ์๋ค.

files directory์๋ index.html์ ๋ง๋ค์ด์ฃผ๊ณ
http://192.168.183.129:1018/files/๋ฅผ ์ ๋ ฅํ๋ฉด index file์ด ์กด์ฌํ๊ธฐ ๋๋ฌธ์

์ด์ ๊ฐ์ ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ ์ ์์ ๊ฒ!
[ summary ]
(1) index file = ์๋ฌด๋ฐ file path ๊ฐ์ด ๋ช ์๋์ง ์์ ๊ฒฝ์ฐ ์ ๊ณต๋๋ ํ์ผ
(2) file name์ด ๋ช ์๋์ง ์์ผ๋ฉด ํด๋น directory์ index file ๋ด์ฉ์ด ์ถ๋ ฅ๋๋ค.
(3) index file์ ๊ฐ directory๋ง๋ค ์ ์ฉ์ด ๊ฐ๋ฅํ๋ค!
Last updated