I-Yoast SEO: Ama-URL we-Canonical kuSayithi ene-Optional SSL

https

Lapho sithuthela isiza sethu ku ligcina uthi lokuphotha luzungeza, asiphoqanga wonke umuntu ekuxhumekeni kwe-SSL (i-https: // url eqinisekisa ukuxhumana okuphephile). Asikanqumi kulokhu. Singaqinisekisa ukuthi ukuthunyelwa kwamafomu kanye nengxenye ye-ecommerce kuvikelekile, kepha asiqiniseki nge-athikili emaphakathi okufanele ifundwe.

Ngalokho engqondweni, sabona ukuthi izixhumanisi zethu ezisohlwini lwezincwadi zeBhayibheli zazibonakala zivikelekile futhi zingavikelekile. Angifundanga okuningi ngesihloko, kepha lokho kubonakala sengathi kungaba yinkinga uma i-Google iphatha indlela ngayinye ngokwehlukana. Ngempela, ngaphakathi kwabaphathi beWebhu, bekufanele sibhalise indawo evikelekile ngokuhlukile ukuze ngicabange nje ukuthi ingadala ukudideka.

Siyini isixhumanisi se-Canonical?

I-canonical link element iyinto engxenyeni eyinhloko yekhasi le-HTML (elingabonakali kubasebenzisi) eliqondisa izinjini zokusesha kunguqulo ekhethiwe yekhasi lewebhu. Lokhu kuyinto ebalulekile lapho ulungiselela isayithi lakho izinjini zokusesha njengoba ufuna ukuqinisekisa ukuthi noma iliphi igunya elidluliswa kuzixhumanisi liya ku-URL efanelekile. Iningi lezinhlelo zokuphathwa kokuqukethwe zikhiqiza izindlela eziningi zokuqukethwe okufanayo. Ngaphandle kwe-canonical yokuchaza indlela efanelekile, igunya lakho lingahlukaniswa phakathi kwezindlela eziningi eziya kokuqukethwe okufanayo.

Ekubuyekezeni i- I-Yoast SEO i-plugin base base, i-plugin imane idonse i-permalink ngokusebenzisa i-WordPress 'function standard. Ngamanye amagama, uma usekhasini eliphephile, kuzobhala uhlu lwe-https, uma ungekho - luzoklelisa indlela ye-http. Ugh.

Ngaphakathi kwengqikithi yethu imisebenzi.php ifayela, nokusebenzisa isihlungi se-Yoast sika-canonical umabhebhana, sengeze umsebenzi olandelayo ukuphoqa zonke izixhumanisi ze-canonical ku-URL ephephile:

umsebenzi mtb_canonical_ssl ($ url) {$ url = preg_replace ("/ ^ http: / i", "https:", $ url); buyisela i- $ url; } i-add_filter ('wpseo_canonical', 'mtb_canonical_ssl');

Manje, noma ngabe iyiphi indlela umsebenzisi ahamba kuyo noma ukuthi isiseshi se-Google siyithatha kanjani i-canonical, izovela kuphela njengekhasi eliphephile elinendlela ye-https: // URL. I-plugin ye-Yoast ibikade inenketho yokuchaza lokhu, kepha kubonakala sengathi yehlisiwe ku-plugin.

2 Amazwana

  1. 1
  2. 2

UCABANGANI?

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