Whenever we get a HTTP 302 error, it requires a redirect and the same questions usually arise:
N’isiokwu a, m ga-aza ajụjụ ndị a niile ka ị nwekwuo nghọta iji gaa n’ihu n’okwu ọ bụla.
Code 302 indicates a temporary redirection.
One of the most notable features that differentiate it from a 301 redirect bụ na, n'ihe banyere 302 ntụgharị, a na-ebugharị ike nke SEO na URL ọhụrụ.
Nke a bụ n'ihi na emegharịala mkpọgharị a ka ọ dị mkpa mgbe ọ dị mkpa ịmegharị ọdịnaya gaa na peeji nke na-agaghị abụ nke doro anya.
Ya mere, ozugbo ewepụrụ redirect, peeji mbụ agaghị enwe ike ịnọ na igwe nchọta Google.
Agbanyeghi na obughi ihe zuru oke na anyi achoghari uzo 302, nhọrọ a nwere ike bara ezigbo uru na oge ufodu. Ndị a bụ oge ikpe:
Ntugharị 302 bụ koodu na-agwa ndị ọbịa nke URL a kapịrị ọnụ na a kpaliri ibe ahụ nwa oge, na-eduzi ha ozugbo na ọnọdụ ọhụrụ.
N’aka ozo, a na-eweghari uzo 302 ka Google robots ma obu igwe ndi ozo choro ibanye otu peeji. N'oge ahụ, ekele maka ntụgharị a, ihe nkesa ahụ na-eweghachi nzaghachi akpaaka na-egosi URL ọhụrụ.
N'ụzọ dị otú a, a na-ezere njehie na mkpasu iwe ma ndị nchọta na ndị ọrụ, na-ekwe nkwa igodo ire ụtọ.
Ntugharị 302 na-eje ozi, dịka ọmụmaatụ, ịnwe ọtụtụ nsụgharị peeji ntanetị n’asụsụ dị iche iche.
The main one can be in English, but if the visitors come from other countries then this system automatically redirects them to a page in their language.
N'ụzọ dị otu a, mkpokọta nke web okporo ụzọ na-enweta, mana n'otu oge ahụ, etinyere mmetụta na ọkwa SEO nke isi peeji adịghị. Nke a na-aga n'ihu na-eto, n'agbanyeghị na enweghị mbufe nke ikike, dịka anyị kọwara na mbụ.
The most common HTTP 302 redirect example case is Google.
Agbanyeghị mba ị na-enweta, ọ bụrụ na i pịnye ebe a https://www.google.com/, you will be redirected to the Google version in the language/country that corresponds to you.
N'ihe banyere Germany, 302 na-eburu anyị na-akpaghị aka https://www.google.de/ ka anyị wee nwee ike chọọ ọdịnaya nke German.
Portals nke ụlọ ọrụ na-aga nke ọma dị ka Coca-Cola ma ọ bụ ọbụna Fujitsu na-ejikwa usoro a emegharị okporo ụzọ gaa ebe ha chere na ọ kachasị adaba.
Here are some of the most common reasons for the 302 redirect error:
Achọpụtaghị HTML redirect 302 mgbe a ga-etinye usoro nke arịrịọ mbụ na arịrịọ nke URL ịchọrọ - dịka ọmụmaatụ, na-ebugharị URL nke ụdị mpempe akwụkwọ na-eji usoro POST maka oge.
Shouldkwesighi iji koodu ọkwa 302 mee ihe ma ọ bụrụ na ịchọrọ ịnyefe SEO-nauyi na URL aga.
Nyochaa na 301 na 302 redirect Ntọala dị mma dị mfe.
When entering into the address bar of the old address, we observe what is happening.
The change of address indicates that everything is fine with the redirect.
The address remains the same – you need to look for the source of the problem, but first, we advise you to clean the cache and try again.
Enwere nhọrọ ọzọ - itinye maka ịlele koodu nzaghachi ihe nkesa na ọrụ ntanetị, dịka ọmụmaatụ, http://example.com/e_redirect/.
Ọ bụrụ na ịtọgharị redirect ọfụma, ịbanyela ngalaba aha, ị ga-ahụ koodu nzaghachi 301 ma ọ bụ 302. Ọ dabere n'ụdị ntụgharị ọzọ ị mere atụmatụ ibido na mbụ.
Servicesfọdụ ọrụ na-egosikwa koodu nyere site na sava ahụ ma atụgharịrị ya, ma, lee, enwere naanị otu nhọrọ bara uru - 200 OK.
Ngwa ahụ nwere ike na-arụ ọrụ na sava ahụ na-eji otu n'ime mmemme sava weebụ abụọ a kachasị, Nginx ma ọ bụ Apache. Ihe sava weebụ abụọ a nwere ihe karịrị pasent 84 nke ihe nkesa sava weebụ zuru ụwa ọnụ!
Therefore, the first step in determining the 302 response code is checking the mandatory redirect instructions in the webserver program configuration file.
To identify the webserver, you need to find the key file. If you are using the Apache web server, locate the .htaccess file in your site’s root filesystem.
Ọ bụrụ na mmemme gị nọ na ngalaba ndị ọbịa, ị nwere ike ịnwe aha njirimara gị na akaụntụ nnabata, dịka ọmụmaatụ. N'okwu a, ọ na - abụkarị, ndekọ nke mgbọrọgwụ mgbọrọgwụ dị n'okporo ụzọ:
/home/<username>/public_html/path, thus the .htaccess file is located at /home/<username>/public_html/.htaccess.
Ozugbo ịchọta faịlụ .htaccess, mepee ya na onye na - ede akụkọ ma chọta ahịrị na - eji iwu RewriteXXX nke ụdị Apache mod_rewrite.
Agbanyeghị, isi ihe bụ na RewriteCond na-edepụta usoro ederede nke atụnyere URL edebanyere aha. Mgbe onye ọbịa rịọrọ URL dakọtara na saịtị, ntuziaka RewriteRule nke na-eso otu ntuziaka RewriteCond ga-emegharị arịrịọ ahụ na URL kwekọrọ.
Dịka ọmụmaatụ, ihe ndị a bụ ngwakọta dị mfe nke RewriteRule na RewriteCond nke na-emeju afọ niile nke example.com, mana tinye itinye redirect na-adịru nwa oge n'ime otu IPI oge nwa oge - example.com:
RewriteEngine na RewriteCond% {HTTP_HOST} ^ atụ \ .com $ RewriteRule ^ (. *) $ HTTP://www.temporary-example.com/$1 [R = 302]
Rịba ama ọkọlọtọ ndị ọzọ na ala RewriteRule, nke gosipụtara n'ụzọ doro anya na koodu nzaghachi ga-abụ 302, na-egosi onye na-ahụ maka ihe nchọgharị na ọ bụ ntụgharị ọzọ.
# Bido na WordPress rewriteEngine na RewriteBase / RewriteRule ^ index \ .php $ - [L] RewriteCond% {REQUEST_FILENAME}! -Figharịdọọ%% {REQUEST_FILENAME}! -D RewriteRule. /index.php [L] # END WordPress
Yabụ, ọ bụrụ na ịnweta iwu RewriteRule pụrụ iche ma ọ bụ rewriteCond na faịlụ .htaccess gị na ya adabaghị na ya, nwaa ịkọwa ha nwa oge (buru ụzọ na #) wee malitegharịa webserver iji chọpụta ma ọ bụrụ na edozi okwu ahụ.
Ọ bụrụ na sava weebụ gị na-arụ ọrụ na Nginx, ị ga-achọ faịlụ dị iche iche nke nhazi. Akọwapụtara faịlụ a dị ka nginx.conf na ndabara wee chọta ya n'otu akwụkwọ ndekọ ahakarị nke edepụtara n'okpuru:
/ usr / obodo / nginx / conf, / wdg / nginx ma ọ bụ, / usr / obodo / wdg / nginx.
Mgbe ịchọtachara, mepee faịlụ nginx.conf na onye ndezi ederede gị wee chọta ntuziaka idegharị na-emetụta njimara ntụgharị.
Iji maa atụ, nke a bụ ntuziaka na-egbochi iwu (ekwuputara otu nkwupụta) nke na-esetịpụ ihe nkesa sava ahụ site na iwepụta redirect nwa oge site na abc.com gaa na oge njikọta-nwa oge:
ihe nkesa {na-ege 80; gee 443 ssl; ihe nkesa_name www.abc.com; degharia ^ / $ http://www.temporary-abc.com redirect; }
Nginx rewirar ntụzi dị na Apache RewriteRule na
RewriteCond n'ihi na ha na-enwekarị usoro nchọta ederede ederede nke gbagwojuru anya.
N'ọnọdụ ọ bụla, lelee nginx.conf faịlụ maka atule mgbakwunye mgbakwunye nwere njigharị ọkọlọtọ (koodu nloghachi azịza ọkọlọtọ 301 ọzọ)
Biko mara ihe dị na nke ọ bụla tupu ịmalitegharị sava ahụ iji chọpụta ma ọ bụrụ na etinyere nsogbu ahụ.
Akwụkwọ nkọwapụta nke RFC maka HTTP 1.0 na-ekwu na ebumnuche nke koodu nzaghachi "302 Achọtara" bụ iji gosi na onye ahịa kwesịrị igbugharị oge ụfọdụ.
However, many new browsers will process the code 302 received through the POST request as an invalid GET request.
This has triggered snags and confusion with particular web server programs that attempt to force the browser to perform the right work when it needs to be redirected temporarily.
Iji dozie nsogbu a, akwụkwọ nkọwa RFC HTTP 1.1 weghachiri koodu nzaghachi 303, ntụgharị ọzọ 307 na-adịru nwa oge, nke bụ ụzọ a ga-aghọta iji jikwaa POST-to-GET ma ọ bụ nwa oge, nzaghachi nwa oge.
Ihe fọrọ nke nta ka ọ bụrụ ngwa weebụ niile na-echekwa ndekọ na sava ahụ. Ndekọ ngwa ahụ na-anọchi anya akụkọ ntinye ihe, dị ka peeji ndị, achọrọ ma jikọọ, nke enwetara na nchekwa data enyere, yana ndị ọzọ.
A na-ejikọ ihe ndekọ sava na ngwaọrụ dị ugbu a na-eme mmemme ma na-enwekarị ozi gbasara ọnọdụ na ahụike nke ọrụ niile ejikọtara, yana ọbụna ozi gbasara sava ahụ.
Google dekọtara [PLATFORM_NAME] na CMS ma ọ bụ jiri [PROGRAMMING_LANGUAGE] wee debanye aha ma debanye aha [OPERATING_SYSTEM] mgbe ị na-ebupụta ngwa ọdịnala maka ozi ndị ọzọ iji nweta ndekọ ndị a.
N'okwu ahụ, usoro niile a tụlere na mbụ dara, nsogbu ahụ nwere ike ịdị na koodu onye ọrụ nke ihe kpatara nsogbu ahụ.
Gbalịa ịchọpụta ihe kpatara nsogbu ahụ site na iji aka gị chọta ngwa ahụ na nyochaa ya na sava ahụ na faịlụ ndekọ ngwa.
Ọ bụ ezigbo echiche idetuo ngwa zuru ezu na kọmputa mmepe mpaghara gị wee banye na ya iji hụ kpọmkwem ihe na-eme nyocha 302 ma hụ koodu maka ngwa ọ bụla.
N'ikpeazụ, dị ka ị hụworo, anyị ekwesịghị ịtụ egwu ọtụtụ gbasara njehie redirect nke HTTP 302. N’agaghị n’ihu, ha bụ ụzọ dị mma iji zere ijufu okporo ụzọ na ibe weebụ anyị na mgbanwe ndị enweghị atụ na-ebilite kemgbe ọtụtụ afọ.
I hope that, after reading this article, you will not get chills every time about how do I fix the 302 moved temporarily error.
Ma ịchọrọ itinye aka na post ahụ ma ọ bụrụ na ị nwere ajụjụ ma ọ bụ na ịchọrọ ikwu echiche gị, egbula oge ikwu n'okpuru!
Hello, Gen Z! Ready to fly high with your dreams? Let no one stop you…
Let's talk about HideMyAss Alternatives! But first, let us talk about HideMyAss. If you’re interested…
These days the theme market is flooded and users are spoiled by choices. But if…
Thinking of starting a video log or want to host your video on a video…
So, you‘re looking for the best ecommerce hosting company for your needs? No matter whether…
Gini mere anyi tukwasiri anyi obi "Anyị aburula onye ahia Turnkey Internet since March 2019.…