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

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

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

[複製鏈接]
發表於 2014-12-24 11:31:59 | 顯示全部樓層 |閱讀模式
tid=193& 本帖最後由 IT_man 於 2014-12-25 11:19 編輯 , Z6 f3 J8 T& W0 W% G
: Q  p3 c3 e: d' I7 ^0 T  N2 ~
在此分為「Host server設定」Discuz 後台設定6 S9 m+ L9 G4 \4 m2 _6 Y# q
Host server設定】    又分為Web server站台根目錄下的.htaccess
' U4 h3 p. S" V& B$ c: ~
  
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">
      : {$ E" @' r8 o$ L( ^/ Y
    2. RewriteEngine On  # 將 RewriteEngine 模式打開0 i6 Q4 r7 N) {
    3. RewriteBase /        #設定為網站的根目錄
      : l6 I4 Z" @& ?! e9 J% b! K
    4. RewriteCond %{HTTP_HOST} ^av4u.info [NC]' h1 i6 ^$ s; V
    5. RewriteRule ^(.*)$ HTTP://www.av4u.info/$1 [L]                                                          3 y7 z* e; {) Y
    6. RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1; l$ b7 @9 S& b5 A& p4 m4 Y
    7. RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
        u  v; W* L& [/ K7 g
    8. RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1, r  O7 ]$ E# p: @# f: R: I
    9. RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1- t  u6 v# D, H
    10. RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
      . @! a/ r7 w3 K, E9 S
    11. RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1  l$ C; Z6 @* X. g
    12. RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1# u: m; _- P, [9 Q# P; l# p3 _
    13. RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%13 w8 A2 U: C+ _! v% i9 d' R+ m4 f! ~' `
    14. Options Includes FollowSymLinks4 R0 f( G, T5 a4 l7 ~: `6 @5 K
    15. AllowOverride All
      1 S+ M5 P! Y* r8 Z6 @1 f" s7 d
    16. Allow from all5 I" Z" w( D/ E: `7 h! |
    17. Order allow,deny, l; Z1 p7 }$ o/ \, v& r& \/ d8 U" e
    18. addDefaultCharset UTF-8
      - a  v3 A" d% b' E
    19. </Directory>- O+ i0 N1 B! \6 _8 D2 J& w
    複製代碼
  • 存檔後重啟httpd : service httpd restart 才會生效

    ! i1 M5 I3 d7 W
    註:有個地方須注意,/etc/httpd/conf/httpd.conf中<Directory "/www/coav4u/test"> 的 AllowOverride 一定要all,.htaccess才有作用
$ y9 L2 ~; q/ E4 y$ R; |

- Z: @  [% p/ H) Y6 {0 t 站台根目錄下的.htaccess
  1. # -FrontPage-) d0 x& d! m3 t4 M& D
  2. IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*  
      {2 Y& \4 p& e5 W. m, ?
  3. # disable directory browsing
    8 V+ m+ y1 b; D3 B4 }+ \3 ~
  4.   Options All -Indexes
    - U7 e9 B+ R2 Z9 |! t
  5. RewriteEngine On    # 將 RewriteEngine 模式打開+ M5 Z' Y! Y; S, [, ?  ^
  6. RewriteBase /    #設定為網站的根目錄; x8 I. {8 ~* \9 f4 A5 g! A4 @
  7. #
    2 j/ s9 g6 r5 c/ d2 t
  8. RewriteCond %{HTTP_HOST} ^av4u.info [NC]0 W: _! g  S3 s# J
  9. RewriteRule ^(.*)$ HTTP://www.av4u.info/$1 [L]<font face="楷體,標楷體"><font size="3">RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1. D' ?; j5 @* a; U' P4 x7 T
  10. RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%10 P6 ?# O3 `& b7 j  p: v
  11. RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
    4 E4 E6 c" y2 `; o
  12. RewriteRule
    / d# A6 W  }9 ~' {' J
  13. ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$
    ' o. @% x% e& J( C
  14. forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
    ) h0 m4 i) K( W, G% D6 L
  15. RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1  J+ w6 C/ X; |; w$ c" m
  16. RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
    : h6 y0 N0 X$ p7 r( w6 y% W# O+ i9 ]
  17. RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
    * @1 B: X0 ~4 T# D
  18. RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1</font></font>
複製代碼
存檔後馬上生效
; Z- h9 H, L* Y  
7 h  y  U0 r$ M8 rDiscuz 後台設定    後台->全局->SEO設置->URL靜態化) Z3 G: z* O) Z4 c3 [
1.png 0 d' D. U: Z8 W7 x+ p- w- [" Y
可以全選或依據網站需要勾選! {/ {: L  G% n

4 {7 T" U6 j" _
回復

使用道具 舉報

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

本版積分規則



中文酷站排行榜

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

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

GMT+8, 2026-3-24 14:34 , Processed in 0.096470 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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