Hướng dẫn kích hoạt Apache mod_rewrite trên CentOS


Để sử dụng được đường dẫn tĩnh cài đặt trong file .htaccess (vd đường dẫn như thế này: http://vinastar.net/ten-mien-viet-nam.html) bạn cần phải kích hoạt mod_rewrite nếu sử dụng server Apache. Cách thức thực hiện điều này như sau:

Cài đặt module Apache mod_rewrite

Mở file cấu hình Apache

nano /etc/httpd/conf/httpd.conf

Chuyển AllowOverride None thành AllowOverride All trong thẻ <Directory “/var/www/html”>

Có thể bạn sẽ cần thay đổi luôn trong thẻ <Directory />

Sau đó khởi động lại Apache là được

service httpd restart


Article ID: 14
Created On: Fri, Feb 26, 2016 at 10:24 PM
Last Updated On: Fri, Feb 26, 2016 at 10:24 PM
Authored by: Đặng Văn Kiên [info@vinastar.net]

Online URL: https://doc.vinastar.net/article.php?id=14