Tối ưu SEO URL bằng Discuz! X 1.5 và htaccess

  1. Mod: SEO URL cho Discuz! X 1.5
  2. Các tệp đã chỉnh sửa: 02 tệp
  • /source/function/function_core.php ( download the attached 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

DOWNLOAD: 

Bình luận về bài viết này