52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
Yahoo!憟拇撠
望: 璈A
Google憟拇撠
望: 璈A
     
亦: 4700|敺: 0
銝銝銝駁 銝銝銝駁

[蝬脤隡箸沘 [SEO] ReWrite 閮剖霈 URL 璅撘霈璅撘(瑁)

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-23 17:59:37 | 芰閰脖 撣 |摨閬 |梯璅∪
砍敺 IT_man 2014-12-24 18:42 蝺刻摩 8 Y5 H% @, M! U4 J/ I

/ p$ P' v* r5 y: o, C) ?, Y望潭蝬脩閬,銝餉舐箔SEO(search engine optimize) in discuz x3.2 敺->典->SEO閮剔蔭->URL(閮剖摮),google鈭銝鈭鞈,憒銝:
$ _) r/ P* U# c1 `* J0 S隞蝝嫘
! {! R1 S( |+ H" D
URL Rewrite(URL撠)臭蝔娜EST (Representational State Transfer嚗銵典噩頧蝘)賊銵嚗摰臭誑 Web Server 銝哨撠雿輻刻靘 URL 脰頧敺嚗喳 Web Server 銝剔蝔撘具3 S! e* k/ b  r4 Y( j5 c
雿輻刻臭誑雿輻刻渲死孵靘頛詨 URL嚗銋 REST 銝餉桃嚗嚗舀撠撘雿喳嚗SEO嚗雿瘜銋銝函撘潸臭誑拍券璈嗡撠賊梯韏瑚嚗舫踹霈蝬脰楝銝⊥雿輻刻園唳拇潛澆餅鞈閮
7 M. q/ J* o& c! @9 d# b& Y4 i% `
# p. u3 v$ h( h4 |9 o
雿輻沖eWrite 閮剖嚗敺嫣噶啣臬祆胯
http://www.av4u.info/forum.php?mod=viewthread&tid=192&extra=page%3D1璅撘URL嚗霈http://www.av4u.info/thread-192-1-1.html敶W 'URL7 S4 S1 S6 G6 w. p. n# T
ReWrite臭誑甇閬銵函內撘靘銵券,潭迤閬銵函內撘隤瘜隢
0 s1 |8 c3 ?  i6 E# q7 D雿輻 ReWrite 憟質鈭:

4 X4 }7 O% n' d9 PI.霈 URL 韏瑚瘥頛哨銝撣嗅貊 'URL' 敶W撠雿輻刻靘隤芣頛蝧嚗
( x7 U$ d& d: }: o- P% ~II.拇 SEO嚗撠撘瘥頛憟賣: S, h  H, T3 d5 Q1 x. j
Rewrite隤瘜( U7 ?# Y2 n! X2 X. A5 R; m" J2 g
隞乩摮1隤芣:
  1. RewriteEngine on
    , ]8 S# ~8 Y1 n" Y6 S" B$ R
  2. RewriteCond %{HTTP_USER_AGENT} ^Mozilla/5.0.*
    & \9 n  O, V: n
  3. RewriteRule index.php index.m.php! V1 q# n4 t6 K  g3 w& \. e
  4. RewriteCond %{HTTP_USER_AGENT} ^Lynx.*
    4 r+ Q- f% J4 x* z9 l. `- V
  5. RewriteRule index.php index.L.php
    $ b; K! g* j3 ]3 L( E1 j
  6. RewriteRule index.php index.b.php
    , M  h& Z- l( T( E  J
銴鋆賭誨蝣
隤蝑:- |; u2 m; k/ y! f$ ^, Y  q
  1. if($_SERVER['HTTP_USER_AGENT'] == 'Mozilla/5.0) //FireFox閬賢6 k) q7 ?' y: Y5 \. l, j
  2. {
    & A: g8 j$ ?. h5 s) Z+ u$ j- f, {
  3. //頧迺ndex.m.php' M) A1 `1 B& C, F* z& K" W
  4. }, [" _/ v2 j2 m. x* r7 c
  5. else if($_SERVER['HTTP_USER_AGENT'] == 'Lynx') //蝘餃閮剖閬賢4 p9 j5 @2 x7 ~. [$ W' K
  6. {+ |2 M2 |9 Y# ~6 g5 o! {9 a
  7. //頧迺ndex.L.php" i' N* j% W; d- [2 H
  8. }9 ]9 g$ \! A; U$ W
  9. else  //嗡祉閬賢
    9 H3 ~5 p' a* G+ o5 Z/ t
  10. //頧迺ndex.b.php
銴鋆賭誨蝣
靘摮2.
& N! P, {* j/ z! B7 F  j
  1. RewriteCond %{REMOTE_HOST} ^host1.* [OR]
    ; y$ K' v% {7 ~2 Q8 x
  2. RewriteCond %{REMOTE_HOST} ^host2.* [OR]
    0 q% e5 N8 |' b; n9 i
  3. RewriteCond %{REMOTE_HOST} ^host3.*# b) q7 g! q6 v
  4. RewriteRule (.*)$ test.php
銴鋆賭誨蝣
憒啣疲ost1host2host3嚗撠梯頝喳啣test.php
, \$ S1 i% a" A/ g: x敺鋆∪臭誑綽RewriteCond隤乩批頛舀涉ND,憒唾OR,閬蝣箇撖怠箔
  F: l+ O3 o- u6 e隞乩隞蝝鄗eWrite隤瘜:

, }3 t8 j3 [) T0 c. Z9 t" [9 lRewriteCond TestString CondPattern [Flags]3 K5 c8 `6 i$ q6 H3 e
TestString  舀銝URL澆璇隞塚靘摮銝剔函舐啣霈詨蝔寄TTP_HOST怎批捆嚗Name= Value嚗嚗臭map嚗萄澆嚗澆鞈憿  X8 |2 R, b& y6 Y" U$ \5 V1 }
CondPattern 舀隞嗅賂隞亦洵鈭靘摮箔嚗撠望
host1.*
+ {! N* K0 F/ a  D" ]Flags       璅霅舐洵銝賂臭誑其蝺頝銝銝璇隞塚汰R銵函內嚗憒瘝[Flags]嚗券勗怎AND嚗銵函內
銝虫- y) l. t9 w! G  Z
嗅臭誑
NC蝑蝑嚗銵函內敹賜亙之撠撖RewriteCond撠勗蝔撘銝剔if隤乩璅嚗銵函內憒蝚血撟曉璇隞嗅瑁RewriteCond銝Y啁RewriteRule隤伐撠望爹ewriteCond憪箇& N* b" X$ P; X2 f
3 w4 U; X/ L* O0 T/ Z
Flags 游冽:
8 f$ w9 U% Q1 ~0 N7 A- A" G
I (ignore case嚗銝蝞∪之撠撖怠撥銵摰摮銝脣寥嚗FLAG敶梢燎ewriteRule隞文豢RewriteCond 隞
2 ~! D& ~$ Z1 H( N; LF (Forbidden) 撠摰X嗥垢嚗甇㎞EWRITING蝔摨銝虫403航炊嚗瘜冽券蝔格瘜銝FORMATSTRING 舐∠函銝血臭誑閮剔蔭箔遙雿蝛箏銝脯/ G7 F& t9 k8 e/ T. C+ K
L (last rule) 銝其遙雿撖怨
冽迨甇a撖怎摨嚗雿輻券FLAG隞仿餅迫嗅鋡恍撖怎URI鋡怠Y閬甈⊿撖
$ `- X) f: n) a" e+ p5 L! dN (Next iteration) 撘瑕買EWRITINGENGINE隤踵渲格銝虫敺剝閬瑼X伐靽格孵靽摮嚗嚗甈⊥貊崇epeatLimit摰潮塚憒詨潸N FLAG撠鋡怠蕭
5 I9 _  L! O- J* ~' I+ E. YNS (Next iteration of the same rule) 隞代璅閮撌乩銝敺詨閬閬蝔摨嚗靘憒撘瑕園銴閬剁嚗RepeatLimit隞斗摰銝銴瑁銝閬憭扳貊殷& F1 J, Y$ l: A" B1 Y' u+ {
P (force proxy) 撘瑕嗥桃URI典折典撥嗥箔誨瘙銝虫蝡喲ISAPI游隞隞瘙嚗敹蝣箄隞摮銝脫臭URI砍霅唬蜓璈蝑蝑血隞撠餈航炊
* ]. }2 Y, V4 ^' WR (explicit redirect嚗撘瑕嗆典摰X嗥垢澆粹摰蝷箏單蝑嚗靘桃URI啣啣嚗摰閬蝬撣豢舀敺閬
3 w" c/ r9 ]6 ARP (permanent redirect) 撟曆[R]璅閮詨雿舐澆301HTTP銝302HTTP隞蝣
. a! Q# d! H2 rU (Unmangle Log) 貸RI臭皞瘙銝舫撖恍瘙閮頛URI6 }1 f# D, X; d6 }: D6 a: V; t
O (nOrmalize) 典祕銵銋璅皞摮銝脯璅皞柿RL-ENCODING嚗銝瘜摮銝脩蝘餃蝑嚗璅閮撠墀RLSURLS-ENDODED剜舀函# W- j1 f; @9 X9 t
CL (Case Lower) 撠撖1 H! s( ?3 V% U/ T- h
CU (Case Upper) 憭批神
8 d5 ]0 f* E. y) X' V3 X  |, @
暺靘鈭,閬憒雿閮剖賢祕曆餈啁,隞乩舀靘摮(.htaccess apachehttpd.conf拍冽迤閬銵函內撘):
$ k/ z" ^3 ^0 [! q, I! ]2 \
  • .htaccess    甇斗暹潛雯蝡寧桅
    1. # -FrontPage-
      8 e8 F) X6 I  o6 v
    2. IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
      $ O. F1 Y2 z' }; `2 H
    3. # disable directory browsing
      ( D) p2 j# y5 ~0 k1 a: ?
    4. Options All -Indexes
      4 Z$ J' |" E1 X$ ~' L& u
    5. RewriteEngine On    # 撠 RewriteEngine 璅∪( q# F" H: T' V8 A6 y7 x$ B$ o
    6. RewriteBase /    #閮剖箇雯蝡寧桅) ~3 l" x4 |9 B, w
    7. #
      / r& S2 w4 j( ~) M# P  m  L
    8. RewriteCond %{HTTP_HOST} ^av4u.info [NC]6 b) R0 @+ S) u
    9. RewriteRule ^(.*)$ HTTP://www.av4u.info/$1 [L]
      - n8 O. D7 ^  f! e
    10. RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$27 v) h( n9 S4 l3 D4 T2 V/ M4 j
    11. RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2
      8 |  X( H' I* m, M
    銴鋆賭誨蝣

    9 ~% }- `+ O7 A+ s  B
  • Apache銋httpd.conf    /etc/httpd/conf/httpd.conf銝血乩蝬脩桅畾萄銝:
    1. <Directory "/www/coav4u/test">/ p, _& F% b; E' `
    2.         RewriteEngine On  # 撠 RewriteEngine 璅∪
      . h* F+ j- @; b: G8 \9 M8 F
    3.         RewriteBase /        #閮剖箇雯蝡寧桅
      ) S6 b8 K- R$ `
    4.         RewriteCond %{HTTP_HOST} ^av4u.info [NC]: q. ^- Q- M" K- A) f* }2 u) H
    5.         RewriteRule ^(.*)$ HTTP://www.av4u.info/$1 [L]7 e5 j: j8 z0 i/ E7 |
    6.         RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2
      1 l% f1 s5 y. E# Z* j' i) E/ m
    7.         RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2
      - r5 z2 Q% n* _2 r: e/ u
    8.         Options Includes FollowSymLinks
      $ \0 U' u+ f/ U( H. x6 q& o1 y, K
    9.         AllowOverride All
      5 z  E8 k$ F' X
    10.         Allow from all
      & C( A. {$ l" s7 Y
    11.         Order allow,deny
      - V! D  j* k, Q2 M
    12.         addDefaultCharset UTF-8
      0 U, [/ ]- ^! C' P' x' Y
    13. </Directory>0 k( k1 G' y9 [8 _5 J) _( S
    銴鋆賭誨蝣
    摮瑼敺閮敺httpd : service httpd restart
    , X. l4 g4 S& K/ x# w" B5 E9 |4 J" l

雿輻券

祉蝛閬

BT蝳

砍憛批捆靘餉衣雯頝臬批捆蝝颲行粹嗥蝬脩嚗摰撟湔遛嚗嚗甇脖誑銝嗅啣摰嗆摰撟湧翩鈭箏ㄚ孵舫脣伐銝憿亙祉璇甈橘芣遛18甇 雓蝯脣亦閬賬粹脩芣遛18甇脖芣撟渡雯閬賜雯頝臭嗥批捆鞈閮嚗撱箄降典舫脰蝬脰楝批捆蝝蝯蝜ICRA蝝摰鋆閮剖 (粹蝯行霅 祉蝬脣銝蝝瘛函隢憯啣嚗祉閮剜蝞∠)

QQ|撠暺撅||52AV璈A

GMT+8, 2024-11-21 20:24 , Processed in 0.063113 second(s), 16 queries .

蝯∠.撱

52avtv@gmail.com | QQ:2405733034     since 2015-01

鋆貉憒 敹恍敺 餈銵