Mengaktifkan SSI (.shtml) pada Virtual Host XAMPP
Untuk menjalankan file dengan ekstensi .shtml di XAMPP, Anda harus mengaktifkan modul include_module pada Apache dan memberikan izin Includes pada direktori Virtual Host Anda. Secara default, Apache tidak memproses SSI untuk alasan keamanan dan performa.
Langkah Konfigurasi Teknis
- Buka file
httpd.confdiC:\xampp\apache\conf\, cari barisLoadModule include_module modules/mod_include.sodan pastikan tidak diawali tanda pagar (#). - Buka file konfigurasi Virtual Host Anda (biasanya di
C:\xampp\apache\conf\extra\httpd-vhosts.conf). - Tambahkan direktif
Options +IncludesdanAddTypedi dalam blok<Directory>.
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/proyek-anda"
ServerName proyek.local
<Directory "C:/xampp/htdocs/proyek-anda">
Options Indexes FollowSymLinks Includes
AllowOverride All
Require all granted
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</Directory>
</VirtualHost>Tabel Parameter Konfigurasi
| Parameter | Fungsi |
|---|---|
| Options Includes | Mengizinkan eksekusi Server Side Includes |
| AddType text/html .shtml | Mendefinisikan tipe konten untuk ekstensi .shtml |
| AddOutputFilter INCLUDES | Memerintahkan Apache memproses file untuk tag SSI |
Troubleshooting
Jika file .shtml masih tidak tampil, periksa log error di C:\xampp\apache\logs\error.log. Pastikan tag SSI ditulis dengan benar, contoh: <!--#include virtual="header.html" -->. Pastikan juga file yang di-include berada dalam path yang benar relatif terhadap root direktori.
🔍 Orang Lain Juga Mencari Ini
Apache Ssi Configuration
Xampp Virtual Host Setup
Mod_include Apache
Enable Shtml In Xampp
Apache Server Side Includes Tutorial
Xampp Httpd-vhosts.conf Settings
Cara Menjalankan File Shtml Di Localhost
Apache Addoutputfilter Includes
Xampp Local Development Environment
Server Side Includes Syntax
Apache Directory Options Includes
Xampp Apache Module Configuration
Troubleshooting Shtml On Apache
Web Development Local Server Setup
Apache Virtual Host Best Practices