Sobatcoding.com - Mengatasi htaccess Not Working di Laragon
Artikel kali ini admin akan berbagi pengalaman saat setting htaccess di CodeIgniter untuk menghilangkan index.php tapi tidak bekerja di Laragon. Biasanya untuk menghilangkan index.php di Codeigniter 3 kita bisa lakukan dengan membuat file .htaccess dengan memasukkan kode sebagai berikut:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
Options All -Indexes
</IfModule>
Tapi hal itu tidak bekerja sama sekali, index.php tetap muncul di URL. Setelah browsing ke sana kemari, akhirnya admin menemukan solusinya. Berikut langkah-langkah untuk mengatasi htaccess tidak bekerja di laragon:
DocumentRoot "C:/laragon/www"
<Directory "C:/laragon/www">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
Sekian tutorial kali ini dan semoga bermanfaat.
Jika teman-teman memiliki pertanyaan atau saran mengenai artikel ini, jangan ragu untuk meninggalkan komentar pada form di bawah ini.
Komentar 0