Back to Question Center
0

Mod_Rewrite Code Semalt: ERR_TOO_MANY_REDIRECTS

1 answers:

Kamar yadda aka bayyana a cikin take, Na haɗu da madaidaiciya madaidaiciya lokacin samun damar shafukan yanar gizonku.

Ga mawallafin rewrite.

     sake rubutawa% {HTTP_REFERER} ^ http: // misali \. com / gwaji / kantin sayar da \. Shin [NC]
RewriteRule ( - sailun. *) $ / gwaji / $ 1 [R]    

To, ta yaya zan warware wannan kuskure ɗin kuskure?

A nan ne fayil ɗin log

     [Mayu 16 12:18:20. 345204 2014] [sake rubutawa: trace3] [shafi 29462: Tsare 1193511232] mod_rewrite. c (475): [abokin ciniki 172. 16. 28. 96: 60187] 172. 16. 28. 96 - - [misali. com / sid # 1e84d1c0] [kawar # 1e954910 / farko] amfani da sashi '(. *) $ 'zuwa gwaji' / gwajin // gwaji // gwajin // gwaji // gwajin // gwaji // gwajin // gwajin // gwajin // gwajin // gwaji // gwaji // gwajin // gwaji // gwajin // gwaji // gwaji // gwaji // gwajin // gwajin / / kantin sayar da. yi ', referer: http: // misali. com / gwaji / ajiya. yi
[Mayu 16 12:18:20. 345213 2014] [sake rubutawa: trace4] [shafi 29462: Tsare 1193511232] mod_rewrite. c (475): [abokin ciniki 172. 16. 28. 96: 60187] 172. 16. 28. 96 - - [misali. com / sid # 1e84d1c0] [kawar # 1e954910 / farko] RewriteCond: shigar = 'http: // misali. com / gwaji / ajiya. yi 'alamar =' ^ http: // misali \\. com / gwaji / kantin sayar da \\. yi '[NC] => wanda ya dace, referer: http: // misali. com / gwaji / ajiya. yi
[Mayu 16 12:18:20. 345218 2014] [sake rubutawa: trace2] [shafi 29462: Tsare 1193511232] mod_rewrite. c (475): [abokin ciniki 172. 16. 28. 96: 60187] 172. 16. 28. 96 - - [misali. com / sid # 1e84d1c0] [kawar # 1e954910 / farko] sake rubutawa / gwaji // gwajin // gwajin // gwajin // gwaji // gwajin // gwajin // gwajin // gwaji // gwajin // gwajin // gwaji // gwajin // gwajin // gwajin // gwaji // gwaji // gwaji // gwaji // gwaji // whatshot_v3 / haha ​​/ store. Do '->' Test / Test // Test // test // test // test // test // test // test // test // test // test / / gwaji // gwaji // gwaji // gwaji // gwaji // gwajin // kantin sayar da. yi ', referer: http: // misali. com / gwaji / ajiya. yi
[Mayu 16 12:18:20. 345233 2014] [sake rubutawa: trace2] [shafi 29462: Tsare 1193511232] mod_rewrite. c (475): [abokin ciniki 172. 16. 28. 96: 60187] 172. 16. 28. 96 - - [misali. com / sid # 1e84d1c0] [rid # 1e954910 / farko] bayyane tilasta turawa tare da http: // misali. com / test // test // test // test // test // test // test // test // test // test // test // test // test // test // test // test // gwajin // gwaji // gwajin // gwaji // gwaji / / kantin sayar da. yi, referer: http: // misali. com / gwaji / ajiya. yi
[Mayu 16 12:18:20. 345239 2014] [sake rubutawa: trace1] [shafi 29462: tid 1193511232] mod_rewrite. c (475): [abokin ciniki 172. 16. 28. 96: 60187] 172. 16. 28. 96 - - [misali. com / sid # 1e84d1c0] [kawar # 1e954910 / farko] tsere http: // misali. com / test // test // test // test // test // test // test // test // test // test // test // test // test // test // test // test // gwajin // gwaji // gwaji // gwaji // gwajin // kantin sayar da. yi don turawa, referer: http: // misali. com / gwaji / ajiya. yi
[Mayu 16 12:18:20. 345245 2014] [sake rubutawa: trace1] [shafi 29462: Tsare 1193511232] mod_rewrite. c (475): [abokin ciniki 172. 16. 28. 96: 60187] 172. 16. 28. 96 - - [misali. com / sid # 1e84d1c0] [kawar # 1e954910 / farko] tura zuwa http: // misali. com / test // test // test // test // test // test // test // test // test // test // test // test // test // test // test // test // gwajin // gwaji // gwaji // gwaji // gwajin // kantin sayar da / kantin sayar da. yi [REDIRECT / 302], tuntubi: http: // misali. com / gwaji / ajiya. yi    

GABATARWA:

Na sami mafita don matsala.

     sake rubutawa% {HTTP_REFERER} ^ http: // misali \. com / gwaji / kantin sayar da \. Shin [NC]
RewriteRule ^ / gwaji - [R, L] #sace don kowane URL ya kasance a karkashin / gwaji. Saboda haka, hana hanawa. Sake rubutawa% {HTTP_REFERER} ^ http: // misali \. com / gwaji / kantin sayar da \. Shin [NC]
RewriteRule ^ / (. *) $ / gwaji / $ 1 [R, L]    
February 12, 2018

Ya kusan kusan shekaru 12 tun lokacin da na yi wani aikin wakilci don haka ina cikin rashin hasara .

Dokarka ta haifar da madauki Kana buƙatar fitarwa. Idan kuna ƙoƙari ya cika wannan a cikin RewriteRule, to, kuna yin gyaran ƙaddamar don neman / gwada / wanda banyi tsammani kuna so ba .

  sake rubutawa% {HTTP_REFERER}! ^ Http: // misali \. com / gwajin / $ [NC]
Sake rubutawa% {HTTP_REFERER} ^ http: // misali \. com / gwaji / kantin sayar da \. yi $ [NC]
RewriteRule. * / gwaji / [R, L] 

Layin farko shine fitar da ku Kuna iya zama mai hukunci mafi kyau. Yana da daga wuri amma ba zuwa wuri ba. A wasu kalmomi, shafi ne wanda mutumin ya bar kuma ba shafin da mutumin yake zuwa ba. Ga wani zaɓi don gwadawa . yi. Kuna iya lura cewa na ƙare-ƙare da maganganun yau da kullum tare da biyu da $. Yayinda wannan bai zama dole ba, yana da mafi sauƙi a yi. Kullum zan iya daukar wani SWAG a ciki.

Ina yin wakili na baya, don haka idan mai amfani ya shiga misali. com / gwaji . Ina so ya yi tsalle zuwa misali. com / gwaji / ajiya. yi .

Idan wannan matsala ce to ku, to, tsarinku na rewrite ya kasance mai sauqi:

  sake rubutawa / gwada /? $ / Gwada / kantin sayar da. yi [R] 

Ba daidai ba ne ka yi amfani da mai fassara a cikin ku sake rubuta rubutun sai dai idan kuna so su toshe canji abin da mutane suke gani bisa ga inda suka fito daga. Alal misali, nuna saƙon kuskure lokacin da mutane suka fito daga wasu wasu shafukan yanar gizo.

Ga dalilan da dokarka ta sake rubutawa:

  • Kuna cewa: "Idan wani ya fito daga / jarraba / ajiya. yi , ƙara karin / gwajin zuwa farkon shafin su na yanzu kuma sake turawa.
  • Mai bincike zai ƙara ƙarin jarraba da kuma turawa, amma juyawa bazai canja mai ba. Zai aika da wannan maimaita sake, wanda zai haifar da irin wannan mulkin.
  • Zaka ci gaba da ƙara / gwada da kuma turawa har sai kun sami karin turawa.

Ban tabbata ba yadda yadda zaku kasance bayan wani wakili na baya yana nunawa ga matsalar ku. Ya kamata ku sami jerin sassan biyu na URLs. Ɗaya daga cikin bayyane mai bayyane, da kuma wanda yake baya kawai. Wani abu kamar:

  • Ƙarshen fuska: http: // misali. com / gwaji / ajiya. yi
  • Ƙarshen ƙarshe: http: // 127. 0. 0. 1: 8080 / commercepackage / 2012 / store. yi

Ba ku faɗi wanene daga cikin wadannan rundunonin suna samun rubutun sake rubutawa akan shi ba. Idan yana a ƙarshen ƙarshen, dokokinku na sake rubutawa suyi amfani da hanyar a kan baya ( / tradepackage / 2012 ), ba hanyar da masu amfani suke gani ba ( / gwaji ).