| 
 | 
 Trước mình có viết hướng dẫn tạo link seo : http://forum.netdepviet.org/toi- ... ccess-5739-1-1.html , giờ tìm lại file đính kèm thì không thấy nữa. 
 Nay viết lại mấy dòng hi vọng giúp được bạn. 
  
File cần sửa: /source/function/function_core.php 
Tìm dòng:  
- define('DISCUZ_CORE_FUNCTION', true);
 
  Sao chép mã 
Thêm vào bên dưới: 
- //SEO-URL for Discuz!X (c) Vic.0
 
 - Tìm đến dòng:
 
 - [code]'{fid}' => empty($_G['setting']['forumkeys'][$fid]) ? $fid : $_G['setting']['forumkeys'][$fid],
 
  Sao chép mã 
Chỉnh thành: 
- //SEO-URL (c) Vic.0
 
 -                         '{tenbox}' => locdau(DB::result_first("SELECT name FROM ".DB::table('forum_forum')." WHERE fid='$fid'")),
 
 -                         //End SEO-URL
 
  Sao chép mã 
function locdau($value) 
        { 
        //bat dau loc dau 
        $locdau_in = array ( 
        '#(A|Ã|À|Ả|Ã|Ạ|Ä‚|Ắ|Ằ|Ẳ|Ẵ|Ặ|Â|Ấ|Ầ|Ẩ|Ẫ|Ậ|á|à |ả|ã|ạ|ă|ắ|ằ|ẳ|ẵ|ặ|â|ấ|ầ|ẩ|ẫ|áº)#',  
        '#(B)#',  
        '#(C)#',  
        '#(D|Ä|Ä‘)#',  
        '#(E|É|È|Ẻ|Ẽ|Ẹ|Ê|Ế|Ề|Ể|Ễ|Ệ|é|è|ẻ|ẽ|ẹ|ê|ế|á»|ể|á»…|ệ)#',  
        '#(F)#',  
        '#(G)#',  
        '#(H)#',  
        '#(I|Ã|ÃŒ|Ỉ|Ĩ|Ị|Ã|ì|ỉ|Ä©|ị)#',  
        '#(J)#',  
        '#(K)#',  
        '#(L)#',  
        '#(M)#',  
        '#(N)#',  
        '#(O|Ó|Ã’|Ỏ|Õ|Ọ|Ô|á»|á»’|á»”|á»–|Ộ|Æ |Ớ|Ờ|Ở|á» |Ợ|ó|ò|á»|õ|á»|ô|ố|ồ|ổ|á»—|á»™|Æ¡|á»›|á»|ở|ỡ|ợ)#',  
        '#(P)#',  
        '#(Q)#',  
        '#(R)#',  
        '#(S)#',  
        '#(T)#',  
        '#(U|Ú|Ù|Ủ|Ũ|Ụ|Ư|Ứ|Ừ|Ử|á»®|á»°|ú|ù|á»§|Å©|ụ|ư|ứ|ừ|á»|ữ|á»±)#',  
        '#(V)#',  
        '#(W)#',  
        '#(X)#',  
        '#(Ã|Ỳ|á»¶|Ỹ|á»´|Y|ý|ỳ|á»·|ỹ|ỵ|y)#',  
        '#(Z)#',  
        "/[^a-zA-Z0-9\-\_]/",  
        '#(@)#', 
        ) ;  
        $locdau_out = array (  
        'a',  
        'b',  
        'c',  
        'd',  
        'e',  
        'f',  
        'g',  
        'h',  
        'i',  
        'j',  
        'k',  
        'l',  
        'm',  
        'n',  
        'o',  
        'p', 
        'q', 
        'r', 
        's', 
        't', 
        'u', 
        'v', 
        'w', 
        'x', 
        'y', 
        'z', 
        '-', 
        '-', 
        ) ;  
 
        $value = preg_replace($locdau_in, $locdau_out, $value);  
        $value = preg_replace('/(-)+/', '-', $value); 
        $value = str_replace(array('-quot', '"'), '', $value); 
        //ket thuc loc dau 
                return $value; 
        } 
//End SEO-URL[/code] 
 
Tìm tiếp phần seo link cho bài viết 
- elseif($type == 'forum_viewthread') {
 
  Sao chép mã 
 
Sửa link thành: 
- //SEO-URL (c) Vic.0
 
 -                         '{tenbai}' => locdau(DB::result_first("SELECT subject FROM ".DB::table('forum_thread')." WHERE tid='$tid'")),
 
 -                         //End SEO-URL
 
  Sao chép mã 
 
Rồi sửa file htaccess 
- <Files ~ "^\.(htaccess|htpasswd)[        DISCUZ_CODE_0        ]quot;>
 
 - deny from all
 
 - </Files>
 
 - # RewriteEngine
 
 - RewriteEngine On
 
  
- RewriteBase /
 
 - ##your forum folder. If your forum: www.netdepviet.org/discuz/ .
 
 - ## the RewriteBase is: RewriteBase /discuz
 
 - # Rewrite
 
 - RewriteCond %{QUERY_STRING} ^(.*)$
 
 - RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
 
 - RewriteCond %{QUERY_STRING} ^(.*)$
 
 - RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
 
 - RewriteCond %{QUERY_STRING} ^(.*)$
 
 - RewriteRule ^(\w+)-([0-9]+)/(.*)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
 
 - RewriteCond %{QUERY_STRING} ^(.*)$
 
 - RewriteRule ^(.*)-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$2&$3&page=$3&%1
 
 - RewriteCond %{QUERY_STRING} ^(.*)$
 
 - RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
 
 - RewriteCond %{QUERY_STRING} ^(.*)$
 
 - RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
 
 - RewriteCond %{QUERY_STRING} ^(.*)$
 
 - RewriteRule ^([a-z]+)-(.+)\.html$ $1.php?rewrite=$2&%1
 
 
  Sao chép mã 
 
 
 Lưu ý: 
Dùng tool compare với file gốc cho dễ edit nhé. 
đây là file discuz_core mà mình đang dùng ( X3.2 ): http://forum.netdepviet.org/seo-url-tinh-discuz.txt |   
 
 
 
 |