a2enmod rewrite
a2enmod rewrite โดยปกติในการเปิดใช้ mod_rewrite ใน Linux มักจะใช้คำสั่ง
sudo a2enmod rewrite |
แต่ บางครั้ง Apache แจ้งว่า module นั้นทำงานแล้ว แต่ ยังไม่สามารถเรียก URL ที่เป็นชื่อได้ (การกำหนดค่า permalink)
ทางแก้ ใช้คำสั่งนี้ เพื่อแก้ค่าไฟล์ apache2.conf
sudo vi /etc/apache2/apache2.conf |
ของเดิม หาให้เจอจะอยู่ในลักษณะนี้
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> |
แก้ไข ตรง AllowOverride None
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> |
sudo systemctl restart apache2 |