temtem Đăng vào 22-12-2010 22:25:28

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

(c) Seo Tip 2.0 by Discuz! Viet

1. Mod Trend: SEO URL for Discuz! X 1.5
2. Edited files: 02 files
+/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-(+)-(+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(\w+)-(+)/(.*)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)-(+)-(+)-(+)\.html$ forum.php?mod=viewthread&tid=$2&$3&page=$3&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^group-(+)-(+)\.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 ^(+)-(.+)\.html$ $1.php?rewrite=$2&%1
03. Login ACP and config like this :)

04. Update Cache and Enjoy

okia123 Đăng vào 23-12-2010 23:42:13

Bản này cũ rồi bạn thân ah.
Bản mới cho ông bạn thân đây http://discuzviet.net/thread/seo-url-cho-discuz-x1-5-ver-2-0-1528-1-1.html
Leech từ http://discuzviet.net thì cũng để cho ng ta cái link chứ :L

temtem Đăng vào 31-12-2016 13:44:46

#Redirect 301
Dùng trong trường hợp Khi chuyển domain từ abc.com sang xyz.com, không muốn index lại toàn bộ link cũ.
Trong file .htaccess của abc.com cấu hình:
Redirect 301 /vn/ http://xyz.com/vn/
Ví dụ khi NDV chuyển từ netdepviet.org/vn sang forum.netdepviet.org thì sẽ cấu hình trên htaccess.
Redirect 301 /vn/ http://forum.netdepviet.org/
Trang: [1]
Xem phiên bản đầy đủ: Tối ưu SEO URL bằng Discuz! X 1.5 và htaccess