PHP AMP Plugin - Soo Degso & Tilmaamo

Iyada oo la adeegsanayo AMP -ga loogu talagalay rakibidda PHP waxaad si fudud, gebi ahaanba si otomaatig ah, ugu abuuri kartaa boggaga AMP ee Google bogaggaaga.

U hagaaji websaydhkaaga PHP aaladaha mobilada iyo Tusmada Koowaad ee Google Mobile adigoon u baahnayn inaad barnaamij u samayso noocaaga AMPHTML ee bogag kasta!

Tijaabi: Ku rakib. Dhaqaaq. Dhamaaday!


Xayeysiinta

Ku rakib AMP PHP plugin


description

Tilmaan ka hor intaadan bilaabin rakibidda gelinta PHP-AMP: Xalalka CMS qaarkood, amp-cloud.de waxay bixisaa plug-ins Google AMP oo gaar ah oo xitaa ka sahlan in la rakibo oo la maareeyo! -Beddelka "AMP for PHP plug-in" , mid ka mid ah soo-raacayaasha AMP ee Google ee soo socda ayaa laga yaabaa inay adiga xiiseeyaan:


Tallaabada-1: Soo dejiso "AMP for Plugin PHP"

Kala soo bax nooca "AMP for PHP Plugin" ee hadda ah faylka ZIP ka soo deg degga soo socda ee soo degsashada ah. - Faylka ZIP wuxuu ka kooban yahay fayl loo yaqaan "amp" kaas oo ka kooban dhammaan faylasha loo baahan yahay in lagu rakibo oo la isticmaalo fiilada AMP.


Tallaabada-2: Soo saar "AMP for Plugin PHP" -ZIP-file

Feeji / soo saar faylka ZIP ee la soo dejiyey.

  • Ka dib furfurista / soo saarista kadib waa inaad hadda haysataa "galka" oo leh magaca "/ amp /" kaas oo ay ku yaalliin faylasha faylasha ee PHP-AMP.

Tallaabada-3: Ku kaydi faylasha faylka PHP server-ka shabakadda

Ku soo rar galka aan zip-ga lahayn ee leh magaca "/ amp /" galka xididka seerfarka mareegta si galka loogala xiriiro mareegahaaga URL-ka soo socda:

  • www.DeineDomain.de/amp/

Si aad u tijaabiso in galka si sax ah loogu keydiyay shabakadaada, si fudud ugu yeer URL-kan soo socda - Haddii rakibitaanku sax yahay, waa inaad aragtaa fariin kuu sheegeysa in websaydhkaagu uu adeegsanayo fiilada AMP ee ka socota amp-cloud.de, haddii kale kumbuyuutarka si sax ah looma rakibin waana inaad martaa tallaabooyinka kor ku xusan markale:

  • www.DeineDomain.de/amp/amp.php
    (Dabcan waa inaad ku beddeshaa www.yourdomain.de cinwaanka degelkaaga)

Talaabada-4: geli calaamadda AMPHTML!

Ugu dambayntii, ku dar inaad riixdo saldhig kasta , oo aad doonayso inaad siiso nooca AMP, adigoo adeegsanaya mid ka mid ah noocyada kala duwan ee <link rel = "amphtml"> - maalin ku jirta <head> qaybta saldhigga u dhigma.

  • Nooca 1:

    <link rel = "amphtml" href = "http: // www.DeineDomain.de /amp/amp.php?url= IhrArtikelURL " />
    • Ku beddel "http: //" qaybta "https: //" haddii aad isticmaaleyso HTTPS websaydhkaaga
    • Ku beddel qaybta "www.yourdomain.de" domainka degelkaaga
    • Ku beddel qaybta "Qodobkaaga URL" adoo adeegsanaya UTF8 qaabaysan oo loo yaqaan 'URL encoded URL' oo ka mid ah bogga hoose oo aad ku darto sumadda 'AMPHflix tag' (oo ay ku jiraan. "Http: //" ama "https: //")

      Si aad si habboon ugu qorto URL, waxaad isticmaali kartaa cinwaannada tooska ah ee bilaashka ah ee "URL", tusaale ahaan: https://www.url-encode-online.rocks/

      Tusaale ahaan UTF-8 URL-ka ku qoran:
      https% 3A% 2F% 2F www.DeineDomain.de% 2FDeinPfad% 2FDeineDatei.php% 3Fparameter% 3DS% C3% BC% C3% 9F% 26sprache% 3DDE

      Tusaale ahaan UTF-8 URL-ka lagu qeexay:
      https://www.DeineDomain.de/DeinPfad/DeineDatei.php?parameter=Süß&sprache=DE

  • Kala duwanaanta 2:

    <link rel="amphtml" href=" http:// ".$_SERVER['HTTP_HOST']."/amp/amp.php?url=".urlencode(" http:// ".$_SERVER['HTTP_HOST'] '].$_SERVER['PHP_SELF']"?".$_SERVER['QUERY_STRING']."")."" />
    • Haddii aad ku isticmaasho HTTPS websaydhkaaga, ku beddel labada qaybood "http: //" "https: //"

AMP lambarka nambarka PHP


code
<?php echo " <!DOCTYPE html> <html> <head> <title> Magacaaga meta... </title> <link rel="amphtml" href="https://".$_SERVER['HTTP_HOST']."/amp/amp.php?url=".urlencode("https://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."")."" /> </head> <body> Summada isha jirkaaga ... </body> </html> ;" ?>

Maxaad u adeegsaneysaa fiilada AMP PHP?


power

Rasmiga AMP ee loogu talagalay plugin-ka PHP ee ka socda amp-cloud.de wuxuu hawlgaliyaa Boggaga Mobilada Xawaareysan (AMP) ee websaydhkaaga ah ee PHP, si toos ah hoosta martigaliyahaaga, sida lagu taliyay tilmaamaha martigeliyaha AMP ee Google!


Xayeysiinta