Phi Vũ
13-12-2013, 20:23
Gửi BQT forum phuot.vn,
Mình thấy forum lâu nay vẫn dùng URL tiếng Việt, ví dụ như:
https://i899.photobucket.com/albums/ac194/TranPhiVu/phuot_zps9258e4e5.png
Như ảnh trên, khi share cho người khác qua IM, mạng xã hội, email... Sẽ rất loằng ngoằng và xấu xí.
Mặt khác, về S.E.O cũng không được tốt.
Mình có giải pháp sau, BQT xem xét có nên dùng không nhé. Riêng mình thấy chỉ có lợi, không có hại.
Sẽ cho ra dạng URL mặc định: http://phuot.vn/baiviet/title-bai-viet.phuot (https://www.phuot.vn/) gọn gàng sạch đẹp.
(hoặc tùy biến phuot.vn/x/title-bai-viet.y - với x và y thay đổi theo ý muốn BQT)
Code sạch sẽ, không include bậy bạ (BB)
_____________________
Thay nội dung .htaccess ở root folder
RewriteEngine on
# If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your vBulletin directory.
# RewriteBase /forum/
# If you are having problems with the rewrite from content/ to content.php, uncomment this line to turn MultiViews off.
# Options -MultiViews
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# Forum
RewriteRule ^baiviet/.* showthread.php [QSA]
RewriteRule ^forums/.* forumdisplay.php [QSA]
RewriteRule ^members/.* member.php [QSA]
RewriteRule ^blogs/.* blog.php [QSA]
RewriteRule ^entries/.* entry.php [QSA]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# MVC
RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]
# Check MVC result
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*)$ - [NC,L]
RewriteRule ^(.*)$ - [R=404,L]
Thay file includes\class_friendly_url.php bằng file này (http://kelbinlei.com/public/upload/class_friendly_url.zip) (forum giới hạn 10k char nên không post thẳng được).
Nếu gặp lỗi ở CMS phuot.vn thì xóa dòng 237:
$fragment = $fragment.".phuot"; đi là ổn.
Thân.
Mình thấy forum lâu nay vẫn dùng URL tiếng Việt, ví dụ như:
https://i899.photobucket.com/albums/ac194/TranPhiVu/phuot_zps9258e4e5.png
Như ảnh trên, khi share cho người khác qua IM, mạng xã hội, email... Sẽ rất loằng ngoằng và xấu xí.
Mặt khác, về S.E.O cũng không được tốt.
Mình có giải pháp sau, BQT xem xét có nên dùng không nhé. Riêng mình thấy chỉ có lợi, không có hại.
Sẽ cho ra dạng URL mặc định: http://phuot.vn/baiviet/title-bai-viet.phuot (https://www.phuot.vn/) gọn gàng sạch đẹp.
(hoặc tùy biến phuot.vn/x/title-bai-viet.y - với x và y thay đổi theo ý muốn BQT)
Code sạch sẽ, không include bậy bạ (BB)
_____________________
Thay nội dung .htaccess ở root folder
RewriteEngine on
# If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your vBulletin directory.
# RewriteBase /forum/
# If you are having problems with the rewrite from content/ to content.php, uncomment this line to turn MultiViews off.
# Options -MultiViews
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# Forum
RewriteRule ^baiviet/.* showthread.php [QSA]
RewriteRule ^forums/.* forumdisplay.php [QSA]
RewriteRule ^members/.* member.php [QSA]
RewriteRule ^blogs/.* blog.php [QSA]
RewriteRule ^entries/.* entry.php [QSA]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# MVC
RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]
# Check MVC result
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*)$ - [NC,L]
RewriteRule ^(.*)$ - [R=404,L]
Thay file includes\class_friendly_url.php bằng file này (http://kelbinlei.com/public/upload/class_friendly_url.zip) (forum giới hạn 10k char nên không post thẳng được).
Nếu gặp lỗi ở CMS phuot.vn thì xóa dòng 237:
$fragment = $fragment.".phuot"; đi là ổn.
Thân.