# Default index page बदलूया

Source: https://ravindrabagale.com/mr/cyber/part-03/ch08-hosting-a-static-website-and-changing-the/8-8-changing-the-index-page.html
Language: mr (Marathi with English technical terms)

Browser directory URL मागतो तेव्हा कोणती file वापरायची हे Nginx चं index किंवा Apache चं DirectoryIndex ठरवतं. क्रम महत्त्वाचा: आधी home.html, नसेल तर index.html.

# Nginx – inside the server block
index home.html index.html;          # try home.html first, then index.html

Apache

# Apache – inside VirtualHost or <Directory>
DirectoryIndex home.html index.html

Test page आणि verification

echo '<h1>Welcome – home.html</h1>' | sudo tee /var/www/mysite/home.html
sudo nginx -t && sudo service nginx reload                 # Nginx
sudo apachectl configtest && sudo service httpd reload     # Apache on Amazon Linux
sudo apache2ctl configtest && sudo service apache2 reload  # Apache on Ubuntu
curl -s http://localhost | head -3

तुम्ही वापरत असलेल्या web server साठीच test/reload command वापरा; तीनही services एकाच वेळी चालवण्याची गरज नाही. मागच्या lesson मध्ये root portfolio केला असेल तर example मधला mysite path active root शी जुळवा.

Missing index आणि listing

Index file नसेल आणि autoindex/Indexes enabled असेल तर files ची list दिसू शकते. Listing बंद ठेवा. नेमका missing-index response access rules/try_files वर अवलंबून आहे; साध्या static directory setup मध्ये 403 दिसू शकतो.

Practice

दोन्ही server labs मध्ये home.html पहिली choice करा. योग्य content येतो का तपासा. मग फक्त test home.html हटवा/हलवा आणि index.html fallback चालतो का पाहा.

रवींद्र बागले यांची tip

जुना page दिसण्याचं कारण cache असू शकतं, पण active config/Host/rootही तपासा. Curl किंवा private browser window वापरा; गरजेनुसार hard refresh करा.
