Qondisa kabusha i-WordPress kuheda

Ukuqondiswa kabusha kweheda yeWordPress

The ukuqondisa kabusha i-plugin eyakhelwe i-WordPress iyindlela enhle yokuhlela nokuphatha ukuqondiswa kabusha. Ngiyisebenzisa kule sayithi futhi ngihlele amaqembu ami okuqondisa kabusha kokuthunyelwe okubuyekeziwe, izixhumanisi ezihambisanayo, ukulandwa, njll.

Kodwa-ke, ngihlangane nenkinga eyingqayizivele lapho ngine-proxy ebekelwe khona ebekelwe iklayenti lapho i-WordPress isebenza khona… kepha hhayi impande yesayithi. Isayithi eliyinhloko lisebenza ku-IIS e-Azure. IIS ingakwazi ukuphatha ukuqondisa kabusha njenganoma iyiphi iseva yewebhu, kepha inkinga ukuthi leli klayenti lizodinga ukufaka ukuqondisa kabusha ukuphathwa kunqubo yabo yokuthuthuka - futhi sebematasa vele.

Inkinga ukuthi ukuqondiswa kabusha kwesitayela se-.htaccess akuyona into engenzeka… kufanele sibhale ukuqondiswa kabusha ku-PHP. Njengesixazululo, sihambisa izicelo ku-WordPress ukukhomba ukuthi kukhona yini okunye ukuqondisa kabusha ezindleleni zakudala.

Ngaphakathi unhlokweni.php ifayela lengqikithi yethu yengane, sinomsebenzi:

function my_redirect ($oldlink, $newlink, $redirecttype = 301) {
	$olduri = $_SERVER['REQUEST_URI'];
	if(strpos($olduri, $oldlink) !== false) {
		$newuri = str_replace($oldlink, $newlink, $olduri);
		wp_redirect( $newuri, $redirecttype );
		exit;
	}
}

Asikhathalelanga ukufaka lo msebenzi ku-works.php ngoba nje kuzobe kuthinta kuphela ifayela leheda. Ngemuva kwalokho, ngaphakathi kwefayela le- header.php, simane nje sinalo lonke uhlu lokuqondiswa kabusha:

my_redirect('lesson_plans', 'lesson-plan');
my_redirect('resources/lesson-plans/26351', 'lesson-plan/tints-and-shades');
my_redirect('about/about', 'about/company/');

Ngalowo msebenzi, ungacacisa futhi ukuthi uluhlobo luni lokuqondisa kabusha ongathanda ukusetha kulo isicelo seheda, simane sakulibuyisela emuva ekuqondiseni kabusha okungama-301 ukuze izinjini zokusesha zikuhloniphe.

UCABANGANI?

Le sayithi isebenzisa i-Akismet ukunciphisa ugaxekile. Funda ukuthi idatha yakho yokuphawula isetshenziswa kanjani.