Thứ Ba, 23 tháng 7, 2013

Kiểm tra mod Rewrite host - SEF URL

Nguồn trích từ Joomla.org

Trường hợp 1:
Rename your htaccess.txt to .htaccess:
Next place ONLY the following lines in your .htaccess:
RewriteEngine On 
Options +FollowSymLinks 
RewriteRule ^joomla\.html http://www.joomla.org/? [R=301,L]
 
Run kiểm tra http://www.example.com/joomla.html nếu trả về website http://joomla.org mod_rewrite hoạt động tốt
Kết thúc - sử dụng lại file .htaccess

Nếu ko được thì kiểm tra bước 2
 
Trường hợp 2:


Now point your browser to: http://www.example.com/joomla.html
Note: if your site is located in a folder such as "/test/" you need to insert the code in the root .htaccess file as follows:
RewriteEngine On 
Options +FollowSymLinks
RewriteRule ^test/joomla\.html http://www.joomla.org/? [R=301,L]

Nếu run trả về http://www.example.com/test
Vào .htaccess chỉnh RewriteBase /test/

Trường hợp 3: Website không hoạt động.
Kiểm tra file .htaccess encoding UTF8 with BOM (trường hợp ở dạng khác host đọc ko được file dẫn đến lỗi)
Cách lưu giống hình:
 
Website không hoạt động - mod-rewrite chưa bật ở host (liên hệ nhà cung cấp). 
 

0 nhận xét:

Đăng nhận xét