Malamulo a WordPress Ali Ndi Zosiyananso, Nawo

mawu apache apache

mawu apache apacheWordPress idapanga gawo lalikulu lakusintha patsogolo papulatifomu, kuyisunthira pafupi ndi makina oyang'anira okhutira kwathunthu ndikuwunika kowunikiranso, kuthandizira kwambiri mindandanda yazikhalidwe, ndi-chochititsa chidwi kwambiri kwa ine-kuthandizira kwamasamba angapo ndikupanga mapu.

Ngati simuli okonda kusamalira zinthu, zili bwino. Mutha kudumpha kupitilira nkhaniyi. Koma kwa ma techno-geek anzanga, ma code-mitu ndi apache-dabblers, ndikufuna kugawana nawo china chosangalatsa, ndi china chake chozizira.

Multi-site ndi gawo lomwe limakupatsani mwayi wogwiritsa ntchito masamba aliwonse a WordPress ndi kukhazikitsa kamodzi kwa WordPress. Ngati mumapereka masamba angapo, ndibwino chifukwa mutha kukhazikitsa gulu lovomerezeka ndi ma widget, ndikuwatsegulira masamba amakasitomala anu. Pali zovuta zingapo zopanga mapu anu, koma njirayi siyovuta.

Limodzi mwamavuto omwe ndazindikira ndi pakusintha kwamitu. Popeza mitu imatha kupezeka pamawebusayiti angapo, zomwe mungachite pamutu zimakhudzanso masamba ena aliwonse ogwiritsa ntchito mutuwu pakukhazikitsa kwanu kwamasamba ambiri. Njira yanga yozungulira ndikungobwereza mutu ndisanayambe kusinthasintha, ndikutchula mutuwo pamasamba omwe ndimakonzera.

Vuto lina losangalatsa ndi zomwe zimachitika mu fayilo ya .htaccess pa seva yanu ya Apache. WordPress iyenera kulembanso njira pamabulogu-ndi-mabulogu ndipo imachita izi ndi lamulo lolembanso ndi fayilo ya php.

WordPress imagwiritsa ntchito lamuloli:

RewriteRule ^ ([_ _ 0-9a-zA-Z -] + /)? Mafayilo /(.+) wp-kuphatikiza / ms-files.php? File = $ 2 [L]

Kwenikweni, chilichonse chomwe chili pamndandanda wa mysite.com/files/directory chimalembedwanso ku mysite.com/files/wp-includes/myblogfolderpath ....... ndipo ndipamene zimasangalatsa. Kodi chimachitika ndi chiyani ngati mukufunikira kukhala ndi fayilo pa seva yanu yomwe ili mysite.com/files/myfolder/myimage.jpg? Mumakhala ndi vuto 404, ndi zomwe zimachitika. Lamulo lolembanso la Apache limayamba ndikusintha njirayo.

Zowona, mwina simudzakumana ndi vutoli, koma ndidatero. Ndinali ndi tsamba lomwe limafunikira kugwiritsa ntchito widget ya javascript kuchokera patsamba lina, ndipo imafunika kupeza zithunzi pa mysite.com/files/Images/myfile. Popeza panalibe njira yosinthira fayilo patsamba lotsatsira, ndinkafunika kupeza njira yochitira izi pa seva yanga. Yankho losavuta ndikupanga kulembanso komwe kumasiyanitsa ndi mafayilo ena.

Pano pali yankho:

RewriteCond% {REQUEST_URI}! /? Mafayilo / Chithunzi / fayilo1.jpg $
RewriteCond% {REQUEST_URI}! /? Mafayilo / Chithunzi / fayilo2.jpg $
RewriteRule ^ ([_ _ 0-9a-zA-Z -] + /)? Mafayilo /(.+) wp-kuphatikiza / ms-files.php? File = $ 2 [L]

Zoyenera kulembanso ziyenera kukhazikitsidwa lamulo loti lilembedwe, apo ayi chinyengo ichi sichingagwire ntchito. Ziyenera kukhala zosavuta kusintha vutoli pazolinga zanu, mukakumana ndi vuto lofananira. Yankho lidandigwirira ntchito, limandilola kuti ndisinthe mawonekedwe azikhalidwe m'malo molemba zinthu zosafunikira zomwe sizikugwirizana ndi kapangidwe kanga. Tikukhulupirira, zidzakuthandizaninso.

Mukuganiza chiyani?

Tsambali likugwiritsa ntchito Akismet kuchepetsa spam. Phunzirani momwe deta yanu ikufotokozera.