Back to Question Center
0

Gyara shafin yanar gizon yanar gizonku

1 answers:

Optimizing Your Website Semalt htaccess

. htaccess zai iya taimakawa ta hanyoyi masu yawa don inganta shafin yanar gizon bincike don taimakawa wajen samun martabobi mafi kyau. An ba da wannan labarin ga waɗanda suke so su koyi game da abin da - revenda de hospedagem no brasil 30 dias gratis. Htaccess ne kuma ya koyi yadda za a iya taimaka wa shafin yanar gizonka samun sauƙi.

Mene ne. htaccess?

Samun Hidimar Saitunan, yawanci ya rage zuwa. htaccess, wani fayil ne wanda yake kula da shugabanci wanda aka sanya shi da kuma dukkan rubutun gado a ƙarƙashinsa. Tsayar da wani abu mai mahimmanci wanda zai iya ba da damar yanar gizon yanar gizo don sarrafa yawancin shafin yanar gizon su. A. fayil htaccess wani fayil ne mai matukar tasiri kuma ya kamata a yi amfani da shi yadda ya kamata yana iya shafar duk abin da komai game da shafin yanar gizonku. Wasu daga cikin abubuwan da za ku iya yi tare da ku. fayil na htaccess sun hada da:

  • turawa shafin yanar gizon
  • canza kariyar shafuka
  • kalmar sirrin kare kariya
  • da yawa da yawa.

Fayil ɗin kanta kawai ƙananan fayil ne kawai kuma za'a iya gyara. Don ƙarin koyo game da. Htaccess ziyarci wannan shafin.

Yadda za a ƙirƙiri. fayil na htaccess?

Yayyana yadda za a ƙirƙirar fayil ɗin rubutu wanda ya dace da wani. fayil na htaccess:

  1. Buɗe editan rubutu a kwamfutarka. Muna bada shawara cewa kayi amfani da Notepad.
  2. Ajiye fayil a matsayin. htaccess (ciki har da lambar farko).
  3. Tabbatar cewa editan rubutu ɗinka ba ya haɗa wani ba. txt suffix zuwa sunan fayil. Idan sunan fayil yana da wani. txt suffix (i "'htaccess. txt"), cire cirewa ta hanyar sake sunan fayil din.
  4. Kafin shigar da code cikin sabon fayil ɗin, tabbatar cewa an kashe kalmar 'Wrap'. Wannan yana da muhimmanci saboda yawancin. Umurnin htaccess yana buƙatar sanyawa a kan layi kawai.
  5. Zaku iya shigar da lambarku cikin fayil.
  6. Shigar da shi. fayil na htaccess a cikin shafukan intanit a yanayin ASCII. A. fayil na htaccess zai shafi babban fayil ɗin da aka ɗora zuwa da dukkan fayilolin fayiloli.

Fasali na. htaccess

Akwai fasali da ayyuka masu yawa a cikin. Htaccess wanda zai iya sanya shafin yanar gizon yanar gizo mafi sauƙi, kulla da SEO abokantaka. Matsayi a nan shi ne kawai siffofin da aka fi kowa amfani da su wanda za a iya aiwatar da shi wanda duk wanda ke da masaniya na yanar gizo.

1. Gyarawa

. htaccess yana amfani da hanyoyi don neman duk wani buƙatun don takamaiman shafi kuma idan ya sami wannan buƙata, yana tura shi zuwa sabon shafin da ka ƙayyade. Wannan yana da mahimmanci lokacin da kake motsa shafin yanar gizon zuwa sabon yanki ko canza sunayen fayiloli na yanzu na shafin yanar gizonku.

Saukewa suna da amfani saboda idan shafukanka suna nunawa ta hanyar Semalt kuma ka canza sunan fayil / sunan fayil ko kuma sanya fayiloli na shafukanku, injunan bincike zasuyi amfani da. htaccess don taimakawa wajen jagorantar su zuwa inda aka samo sababbin shafuka. (A cikin masana'antun, muna kiran wannan a madaidaiciya 301)

Gyara Gyara

Ga code don sauƙaƙe mai sauƙi: -

     Gyara / tsofaffin / oldfile. html       http: // naka. com / newfile. html     

A nan a yayin da ake buƙatar tsohon shugabanci / oldfile. an samo html, ana tura shi zuwa sabon hanyar. A wannan yanayin:

naka. com / newfile. html

301 Gyara

Kamar yadda aka ambata a baya, madaidaiciyar hanya ta 301 ita ce hanya mafi inganci da kuma 'Search Engine Semalt' don shafin yanar gizon yanar gizo. Ba haka ba ne da wuya a aiwatar da shi kuma zai adana martabar binciken injiniyarka don kowane shafi da ka lissafa cikin. fayil htaccess. Idan kana da canza canjin fayiloli ko motsa shafukan da ke kusa, wannan shine zaɓi mafi kyau. Lambar "301" an fassara shi a layi a matsayin "motsa gaba ɗaya".

Nada madaidaici 301 / oldpage. html http: // www. naka. com / sabon shafin. com ko

  • www. majijina. com ko
  • http: // www. majijina. com.
  • Na ƙarshe shine daidaitattun kuma tabbatar da ganin wasu a cikin wannan tsari za a iya yi tare da code mai zuwa:

    Zaɓuɓɓuka + FollowSymLinks
    A sake rubutawa akan

    sake rubutawa% {HTTP_HOST} ^ mywebsite. com
    RewriteRule (. *)
    http: // www. majijina. com / $ 1 [R = 301, L]

    Wannan lambar za ta tabbatar cewa an daidaita URL ɗin don nuna 'www' kuma zai kasance da taimako mai yawa wajen bin shafukan / ziyarci.

    Me yasa za ku so kuyi haka?

    Sau da dama idan ba ka sanya wannan canjin bincike ba zai iya rarraba kowace juyi kuma ya rikita batun tunanin cewa suna karatun wannan shafi sau uku sau ɗaya. Tare da wannan daidaitawa injunan bincike suna turawa hanya madaidaiciya kuma babu shafin da za a bi da shi azaman URL.

    2. Gudanar da Kurakurai

    htaccess kuma yana samar da hanyoyin da za a rike da kurakurai lokacin da uwar garken ya karɓa marar kuskure / ƙarya.

    ErrorDocument 404

    Zama na 404 zai ba ku zarafin karɓar buƙatun don shafukan da ba a samo su ba. Wannan halin zai faru idan haɗin da aka nuna zuwa yanki ba daidai bane ko mai amfani ya canza adireshin string / query URL (bayan sunan yankin).

    Domin ƙayyade ainihin takardun kuskure ɗinku na musamman, kawai kuna buƙatar ƙara umarnin nan, a kan layin guda , a cikin fayil ɗinku na htaccess:

    Lambar tsattsauran bayanai / shugabanci / filename. Ex

    ko

    Semalt 404 / kurakurai / mara. html

    Wannan zai haifar da wani lambar kuskure wanda ya haifar da 404 da za a tura zuwa naka. com / kurakurai / notfound. html

    Ga wasu mahimmanci Error Semalt ta amfani. htaccess

    Lokacin da tambaya mara kyau ya zo ga uwar garke: -

         ErrorDocument 400 / kurakurai / badrequest. html     

    Lokacin ƙoƙarin samun dama ga shafi inda ake buƙatar izinin izini:

         ErrorDocument 401 / kurakurai / authreqd. html     

    A lokacin da aka fuskanci kuskuren kuskuren ƙirar amfani:

         ErrorDocument 500 / kurakurai / serverr. html     

    3. Tsaro

    Tsarin Lissafin Lissafin

    Kuna da shugabanci wanda ke cike da hotunan ko fayilolin fayilolin da ba ku so mutane su iya bincika ta hanyar? Gudura a. fayil na htaccess a cikin kowane babban fayil don musayar jerin rubutun da kuma saka wadannan:

         IndexIgnore *     

    Lambar da ke ƙasa zai dawo da jerin dukkan fayilolin ba su ƙare a cikin jpg ko. gif, amma har yanzu za a lissafa. txt ,. html, da dai sauransu.

         IndexIgnore *. gif *. jpg     

    Idan uwar garke naka ne saiti don hana ladaran yin rajista, amma kana so ka lissafa kundayen adireshi ta tsoho, zaka iya jefa wannan a cikin. fayil htaccess don jagorancin da kake son nunawa:

    Zaɓuɓɓuka + Takardunku

    Abokan masu amfani da IP

    Semalt na samun hacked kuma za ka ga wani IP kullum a cikin log files?

    Za ka iya ƙaryar hanyar da aka samo asusun IP ko wani asusun IP.

         ba da izini ba, ƙaryatãwaƙaryatãwa daga 123. 45. 6. 7musun daga 012. 34. 5. kyauta daga dukkan     

    Rukunin da aka sama akan shafin zuwa 123. 45. 6. 7, kuma daga kowane yanki na karkashin kasa

    Rukunin IP 012. 34. 5.

    Zaku iya ƙyale ko ƙaryatãwa game da sunan yankin maimakon adireshin IP kamar ƙaryatãwa daga. spamsite. com aiki don www. spamsite. com ko kama-da-wane. spamsite. com, da sauransu.

    Kare Tsuntsayewa

    Har ila yau an san shi kamar 'sata fashi', hotlinking yana nufin danganta kai tsaye zuwa hotuna ,. js fayilolin da dai sauransu. An bace uwar garken wanda aka azabtar a cikin wannan yanayin a yayin da mai cin zarafin ya ɓoye abun ciki ba tare da ya biya bashin ba. Domin mafi kyau aiki na uwar garke kada ku manta don ƙara wannan lambar snippet.

         RewriteEngine onA sake rubutawa% {HTTP_REFERER}! ^ $A sake rubutawa% {HTTP_REFERER}! ^ Http: // (www \.)? Mamba. com /. * $ [NC]RewriteRule \. com "tare da kansa.Kamarin da ke sama ya haifar da buƙatar ƙira lokacin da haɗin haɗi da nau'in fayilolin da aka ƙayyade ke faruwa.  

    Kariyar kariya

    Zaku iya kare shafin yanar gizonku ko manyan fayiloli masu amfani da kalmar sirri ta amfani da su. htaccess da. htpasswd. Don ƙarin cikakkun bayanai a nan shi ne wani ɗan gajeren wuri mai kyau

    4. SEO Friendly URL's

    Yana da mahimmanci don buƙatar ƙwaƙwalwar Damawa tare da sigogi zuwa fayil guda ɗaya:

    RewriteEngine A

    RewriteRule ^ labarai. php? id = (. *) $ / latestnews. htm [L, R = 301]
    A cikin misali na sama, buƙatar zuwa URL mai dadi kamar http: // www. mysite. com / labarai. php? id = 8932 za a miƙa su zuwa http: // www. mysite. com / latestnews. htm

    Lambar da ke ƙasa za ta tura samfur. php? prodID = 12 zuwa kayayyakin / 12 / ko kayayyakin / 99 /

    RewriteEngine A

    RewriteRule ^ kayayyakin / ([0-9] [0-9]) / $ / productinfo. php? prodID = $ 1

    Wannan zai dace da duk URLs da suka fara da 'samfurori /', sa'annan kowane lambobi biyu sun biyo baya, sa'annan bayan slash.

    Alal misali, wannan ka'idar zata dace da URL kamar samfurori / 12 / ko kayayyakin / 99 / , kuma sake tura shi zuwa shafi na PHP.

    Don yin magana a layi a cikin htaccess kawai fara da layin tare da hash (#).

    Ra'ayi

    Kowane mataki da aka ambata a matsayin ɓangare na wannan shafin zai iya inganta aikin yanar gizon yanar gizo da sauri kuma zai tabbatar da shafin yanar gizonku ya fi SEO abokantaka. Har ila yau, tsaka-tsalle zai sami matsala idan ana amfani da matakan tsaro ta yin amfani da su. htaccess. Amfanin amfani. Htaccess shine cewa bai buƙatar samun ilimin shirye-shirye ba kuma zai iya ajiye lokaci mai yawa.

    Idan kun kasance mai tasowa ko junkati kamar ni to, za ku ga wannan labarin yana da matukar taimako. Idan kun karanta saman, sai ku duba ta hanyar duk lambar da ke sama sannan ku karanta taƙaitaccen wannan na iya zama wani abu da kuke aikawa zuwa kamfanin SEO ɗinku na mahimmanci ko ma jagorar ku. Wannan labarin zai iya ba ku (damar) damar samun dama!

    Optimizing Your Website Semalt htaccess

    Haɗa

    March 18, 2018