View: 7081|Reply: 2

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

[Copy link]
Posted on 22-12-2010 22:25:28 | Show all floors |Reading mode
(c) Seo Tip 2.0 by Discuz! Viet
lethihathu18.jpg
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
  1. <Files ~ "^\.(htaccess|htpasswd)[        DISCUZ_CODE_0        ]quot;>
  2. deny from all
  3. </Files>
  4. # RewriteEngine
  5. RewriteEngine On

  6. RewriteBase /
  7. ##your forum folder. If your forum: www.netdepviet.org/discuz/ .
  8. ## the RewriteBase is: RewriteBase /discuz
  9. # Rewrite
  10. RewriteCond %{QUERY_STRING} ^(.*)$
  11. RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
  12. RewriteCond %{QUERY_STRING} ^(.*)$
  13. RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
  14. RewriteCond %{QUERY_STRING} ^(.*)$
  15. RewriteRule ^(\w+)-([0-9]+)/(.*)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
  16. RewriteCond %{QUERY_STRING} ^(.*)$
  17. RewriteRule ^(.*)-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$2&$3&page=$3&%1
  18. RewriteCond %{QUERY_STRING} ^(.*)$
  19. RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
  20. RewriteCond %{QUERY_STRING} ^(.*)$
  21. RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
  22. RewriteCond %{QUERY_STRING} ^(.*)$
  23. RewriteRule ^([a-z]+)-(.+)\.html$ $1.php?rewrite=$2&%1
Copy code
03. Login ACP and config like this

04. Update Cache and Enjoy
Reply

Use item Report

Posted on 23-12-2010 23:42:13 | Show all floors
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 ... r-2-0-1528-1-1.html
Leech từ http://discuzviet.net thì cũng để cho ng ta cái link chứ
Reply GOOD NORMAL

Use item Report

 OP| Posted on 31-12-2016 13:44:46 | Show all floors
#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.
  1. Redirect 301 /vn/ http://forum.netdepviet.org/
Copy code
Reply GOOD NORMAL

Use item Report

You need to log in to reply. Login | Register

Points Rules for This Section

Theo dõi bản tin
Archiver|Mobile|Facebook|Contact|Netdepviet.org

Giữ gìn bản sắc dân tộc · Trân trọng quá khứ, hướng tới tương lai。

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

InThis boardPost
Kết nối Zalo
Back to top