52AV手機A片王|52AV.one

 找回密碼
 立即註冊
查看: 2910|回復: 0

[網頁伺服器] discuz x3.2的SEO設定

[複製鏈接]
發表於 2014-12-24 11:31:59 | 顯示全部樓層 |閱讀模式
tid=193& 本帖最後由 IT_man 於 2014-12-25 11:19 編輯 " V2 @, u; Q& p" g

5 n5 n: L+ X$ r9 x0 {) }( H# n2 C在此分為「Host server設定」Discuz 後台設定
) E7 h3 @, d# S
Host server設定】    又分為Web server站台根目錄下的.htaccess
5 U+ H/ `, U7 i# a5 k+ q
  
Web server
  • 檢查web server是否啟動 rewrite 模組    以Apache(其他如Nginx道理相同只是方法不同)為例,開啟/etc/httpd/conf/httpd.conf找到是否有這行  LoadModule rewrite_module modules/mod_rewrite.so有才可繼續下列動作
  • 加入Rewrite設定    於/etc/httpd/conf/httpd.conf加入你的網站目錄段如下:
    1. <Directory "/www/coav4u/test">& C$ N: c0 G, \/ `% I) V2 S( t0 ^
    2. RewriteEngine On  # 將 RewriteEngine 模式打開
      9 I) g  i0 ?1 w1 J! q, H( r
    3. RewriteBase /        #設定為網站的根目錄/ C( z$ d& c( Q) N1 g
    4. RewriteCond %{HTTP_HOST} ^av4u.info [NC]
      . j3 Y: x2 ~. n; K
    5. RewriteRule ^(.*)$ HTTP://www.av4u.info/$1 [L]                                                         
      - d3 L: t' \6 U
    6. RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1# B. {2 n0 [) l- |7 ^1 j3 s' |+ B
    7. RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%14 n1 I0 T) A; _1 _. i
    8. RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%13 g( F2 A) m1 L( E* C: A
    9. RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
      0 u% {& \' T2 `. o. |% [# l% J
    10. RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
      : V% @' j1 {- a! B; Y& L" a
    11. RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%16 B0 ^2 v# g/ @. _0 l- u
    12. RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
      % @- d) }! y+ }8 S. l3 u
    13. RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1% R! F( p1 r* \4 [/ P) n2 z
    14. Options Includes FollowSymLinks
      : ~  R5 \  U5 p" o( `$ U
    15. AllowOverride All
        u+ _$ X  M: h6 b( y( p
    16. Allow from all7 {, _* M6 h$ W1 ~' H
    17. Order allow,deny
      6 k+ _5 W9 Y4 O( y0 B/ b0 ], Z
    18. addDefaultCharset UTF-8; r+ `3 l2 l) c8 H& c# }
    19. </Directory>% R* q; [0 U  U/ M" p
    複製代碼
  • 存檔後重啟httpd : service httpd restart 才會生效

    1 k% s' q% K% U; b/ L% H
    註:有個地方須注意,/etc/httpd/conf/httpd.conf中<Directory "/www/coav4u/test"> 的 AllowOverride 一定要all,.htaccess才有作用
2 A% H, D( L0 C  k3 K
  [: I3 w  y/ e! c. r5 c) R8 B
站台根目錄下的.htaccess
  1. # -FrontPage-
    3 y- ?: a7 [3 }& z8 }9 R
  2. IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*  
    & q  a) s3 J* Z! t
  3. # disable directory browsing
    5 U+ r8 J! @* K# D
  4.   Options All -Indexes5 i/ \! p( Y4 L* e$ n# ^
  5. RewriteEngine On    # 將 RewriteEngine 模式打開
    ; y5 l2 r: e6 u. s2 }; _! I
  6. RewriteBase /    #設定為網站的根目錄
    6 {0 {& n1 V5 f& c) D* U
  7. #( s4 K, W' |; p9 B6 I* x. y
  8. RewriteCond %{HTTP_HOST} ^av4u.info [NC]
    2 ~! \8 X" h: F* i; V0 ~
  9. RewriteRule ^(.*)$ HTTP://www.av4u.info/$1 [L]<font face="楷體,標楷體"><font size="3">RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1+ _! Y* |4 e% G( j( \1 W
  10. RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
    9 m( \. F, v. r- |
  11. RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%13 I- H5 i  c  v4 g3 V
  12. RewriteRule/ {7 w5 a8 T5 G
  13. ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ % X8 U7 |) W3 \' r
  14. forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
    6 P+ y% U, G0 D+ R
  15. RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1% `' P; G6 y" w' f
  16. RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%19 P% s. P5 h+ D/ ~8 N( s
  17. RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1- I9 X# x% c# _8 Q
  18. RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1</font></font>
複製代碼
存檔後馬上生效
9 w4 m/ S, r1 N& t3 t+ _  
5 |, n' ~( D  R& R/ k: @Discuz 後台設定    後台->全局->SEO設置->URL靜態化3 z  f. z& g$ ]. T) S5 e
1.png . P0 A) {! t& K! g" K  a8 c
可以全選或依據網站需要勾選) }+ c. B! {/ Z/ Y

0 z: i. e9 G" d9 T; ^8 d  Q
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則



中文酷站排行榜

本區塊內容依據『電腦網路內容分級處理辦法』為限制級網站,限定年滿18歲以上或達當地國家法定年齡人士方可進入,且願接受本站各項條款,未滿18歲 謝絕進入瀏覽。為防範未滿18歲之未成年網友瀏覽網路上限制級內容的圖文資訊,建議您可進行網路內容分級組織ICRA分級服務的安裝與設定。 (為還給愛護 本站的網友一個純淨的論壇環境,本站設有管理員)

QQ|小黑屋|手機板| 52AV手機A片王

GMT+8, 2025-12-6 18:28 , Processed in 0.067495 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回復 返回頂部 返回列表