Pretty URL untuk Web di Linux Mint 19

Pretty URL untuk Web di Linux Mint 19

5 Februari 2018
/ / /

Langkah 1 — Aktifkan modul mod_rewrite

Langkah awal agar Apache dapat memahami aturan rewrite (baca tulis), kita harus mengaktifkan modul mod_rewrite.  Biasanya modul ini sudah terinstall, tapi masih di disabled oleh apache. Gunakan perintah a2enmod command untuk mengaktifkannya:

Lanjutkan dengan me-restart apache dengan perintah

mod_rewrite sudah aktif, selnjutnya urus file .htaccess

Langkah 2 — Setting Up .htaccess

An .htaccess file allows us to modify our rewrite rules without accessing server configuration files. For this reason, .htaccess is critical to your web application’s security. The period that precedes the filename ensures that the file is hidden.

Before you start using .htaccess files, you’ll need to set up and secure a few more settings.

By default, Apache prohibits using an .htaccess file to apply rewrite rules, so first you need to allow changes to the file. Open the default Apache configuration file using nano or your favorite text editor.

Inside that file, you will find a <VirtualHost *:80> block starting on the first line. Inside of that block, add the following new block so your configuration file looks like the following. Make sure that all blocks are properly indented.

/etc/apache2/sites-available/000-default.conf

Save and close the file. To put these changes into effect, restart Apache.

Demikian sekilas informasi, semoga bermanfaat untuk kita semua. Semoga jadi assets dan ibadah untuk kita semua, Aamiin (ms).

About Author

About Muhidin Saimin

Teacher, Trainer & Programmer

Tinggalkan Balasan

This site uses Akismet to reduce spam. Learn how your comment data is processed.