Dokokin WordPress Suna da Keɓaɓɓu, Hakanan

wordpress apache
Lokacin Karatu: 2 minutes

wordpress apacheWordPress ya sami babban ci gaba na cigaban juyin halitta a cikin dandalin rubutun ra'ayin kanka a yanar gizo, yana matsar dashi kusa da cikakken tsarin gudanar da abun ciki tare da bibiyar bita, karin tallafi ga menu na al'ada, da kuma – fasalin da ya fi birge ni-na tallata shafukan yanar gizo tare da taswirar yanki.

Idan ba ku tsarin sarrafa abun ciki bane, yana da kyau. Kuna iya tsallake daidai wannan labarin. Amma ga takwarorina masu fasahar kere-kere, masu kodin-kode da masu iya magana, ina so in raba wani abu mai ban sha'awa, kuma wani abu mai sanyi.

Multi-site shine fasalin da zai baka damar gudanar da kowane adreshin yanar gizo na WordPress tare da shigarwa na WordPress ɗaya. Idan kuna gudanar da shafuka da yawa, yana da kyau saboda zaku iya shigar da rukunin jigogi da widget din da aka amince da su, sannan ku kunna su don rukunin yanar gizon ku. Akwai wasu 'yan matsaloli na fasaha don taswirar wurarenku, amma aikin ba shi da wahala.

Ayan wuraren matsalolin da na gano shine cikin keɓance taken. Tunda za'a iya samar da jigogi ga rukunin yanar gizo da yawa, duk wasu keɓancewa da kuka yi wa jigo shima zai shafi kowane rukunin yanar gizo ta amfani da wannan taken akan shigarwar rukunin yanar gizonku da yawa. Hanyar da zan bi game da wannan shine yin kwafin jigo kafin in fara kirkirar abubuwa, kuma a bayyane taken taken ga rukunin abokin huldar da nake tsara shi.

Wani batun mai ban sha'awa shine abin da ke faruwa a cikin fayil ɗin .htaccess akan sabar Apache. WordPress yana buƙatar sake rubuta hanyoyi a kan tushen yanar gizo-kuma-yayi hakan tare da sake rubuta doka da fayil ɗin php.

WordPress yayi amfani da dokar sake rubutawa mai zuwa:

Sake RubutaRule ^ ([_ 0-9a-zA-Z -] + /)? Fayiloli /(.+) wp-hada / ms-files.php? File = $ 2 [L]

Ainihin, duk wani abu da yake a cikin subdirectory na mysite.com/files/directory ana sake rubuta shi zuwa mysite.com/files/wp-includes/myblogfolderpath… kuma wannan shine wurin da yake da ban sha'awa. Menene zai faru idan da gaske kuna buƙatar samun fayil akan sabarku shine mysite.com/files/myfolder/myimage.jpg? Kuna samun kuskure 404, wannan shine abin da ya faru. Dokar sake rubuta Apache ta fara aiki kuma ta canza hanyar.

Gaskiya, wataƙila ba za ku taɓa fuskantar wannan matsalar ba, amma na yi hakan. Ina da rukunin yanar gizo wanda yake buƙatar amfani da widget din javascript daga wani gidan yanar gizo, kuma yana buƙatar nemo zane a mysite.com/files/Images/myfile. Tunda babu wata hanya ta canza fayil din a shafin mai masaukin baki, sai na bukaci gano hanyar da zanyi wannan a sabar tawa. Amfani mai sauƙi shine ƙirƙirar yanayin sake rubutawa wanda ke sanya keɓance don takamaiman fayiloli.

Ga mafita:

Sake sake rubutawa% {REQUEST_URI}! /? Fayiloli / Image / file1.jpg $
Sake sake rubutawa% {REQUEST_URI}! /? Fayiloli / Image / file2.jpg $
Sake RubutaRule ^ ([_ 0-9a-zA-Z -] + /)? Fayiloli /(.+) wp-hada / ms-files.php? File = $ 2 [L]

Dole ne a sanya yanayin sake rubutawa kafin dokar sake rubutawa, ko kuma wannan dabara ba zata yi aiki ba. Ya kamata ya zama da sauƙi a gyara wannan yanayin don amfaninku, idan kun haɗu da irin wannan matsalar. Maganar tayi aiki sosai a gare ni, yana bani damar maye gurbin zane-zane na al'ada maimakon ƙaramin alt rubutu mara dacewa wanda bai dace da zane na ba. Da fatan, zai yi aiki a gare ku, ku ma.

Me kuke tunani?

Wannan shafin yana amfani da Akismet don rage spam. Koyi yadda aka sarrafa bayanan bayaninka.