What's new

Về URL của forum phuot.vn

Phi Vũ

Phượt thủ
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ư:





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 gọn gàng sạch đẹp.
(hoặc tùy biến phuot.vn/x/title-bai-viet.y - với xy thay đổi theo ý muốn BQT)


Code sạch sẽ, không include bậy bạ (BB)
_____________________


Thay nội dung .htaccess ở root folder

PHP:
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 (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:
PHP:
$fragment = $fragment.".phuot";
đi là ổn.




Thân.
 
Last edited:

Hỏi Phượt

Forum statistics

Threads
56,679
Bài viết
1,154,695
Members
190,157
Latest member
ngoisaotravel
Back
Top