Kr@z7_&_U3vNtv_$>

Cấu hình CleanURL cho Drupal

Posted in Drupal CMS by krazv7rvn9 on 09/06/2009

Để thiết lập chế độ Clean URL cho Drupal, trước tiên ta phải bật module rewrite cho apache:


$> cd /etc/apache2/mods-enabled
$> ln -s ../mods-available/rewrite.load ./
$> /etc/init.d/apache2 restart

Tiếp đó, cho phép sử dụng file .htaccess để sửa đổi thiết lập của thư mục web. Mở file /etc/apache2/site-enabled/<tên site>, sửa lại dòng AllowOverride từ None thành All.

Cuối cùng, ta tạo 1 file .htaccess để bật module Rewrite lên cho Drupal. File có nội dung như sau:


RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Tagged with: , , , ,
Follow

Get every new post delivered to your Inbox.