I-PHP AMP Plugin - Landa & Iziqondiso

Nge- plugin ye-AMP ye-PHP ungakwazi kalula, ngokuzenzakalelayo, ukwenza amakhasi e-Google AMP akhelwe amawebhusayithi akho.

Lungiselela iwebhusayithi yakho ye-PHP yamadivayisi eselula ne- Google Mobile First Index ngaphandle kokuhlela uhlelo lwakho lwe-AMPHTML ekhasini ngalinye lakho!

Ihlole: Faka. Yenza kusebenze. Qedela!


Isikhangiso

Faka i-plugin ye-AMP PHP


description

Ithiphu ngaphambi kokuthi uqale ukufaka i-plug-in ye-PHP-AMP: Kwezinye izixazululo ze-CMS, i-amp-cloud.de inikeza ama-plug-in akhethekile e-Google AMP okulula ukuwenza nokuwaphatha! - Njengenye indlela "ye-AMP ye-plug-in ye-PHP" , enye yalezi ezilandelayo ze-Google AMP plug-in ingase ibe nentshisekelo kuwe:


Isinyathelo-1: Landa i- "AMP ye-PHP Plugin"

Landa inguqulo yamanje ye-"AMP ye-PHP Plugin" njengefayela le-ZIP usebenzisa isixhumanisi sokulanda esilandelayo. - Ifayela le-ZIP liqukethe ifolda ebizwa ngokuthi "amp" equkethe wonke amafayela adingekayo ukuze kufakwe nokusebenzisa i-plugin ye-AMP.


Isinyathelo-2: Khipha i- "AMP for PHP Plugin" -ZIP-file

Vula / khipha ifayela le-ZIP elilandiwe.

  • Ngemuva kokukhipha / ukukhipha manje kufanele ube "nefolda" enegama "/ amp /" lapho kutholakala khona amafayela we-plugin ye-PHP-AMP.

Isinyathelo-3: Gcina amafayela we-plugin we-PHP kuseva yewebhu

Faka ifolda engafakwanga uziphu enegama "/ amp /" enkombeni yomsuka yesiphakeli sakho sewebhu ukuze ifolda ifinyelelwe kuwebhusayithi yakho ngaphansi kwe-URL elandelayo:

  • www.DeineDomain.de/amp/

Ukuhlola ukuthi ngabe ifolda igcinwe kahle yini kuseva yakho yewebhu, mane ubize i-URL elandelayo - Uma ukufakwa kulungile, kufanele ubone umyalezo okutshela ukuthi iwebhusayithi yakho isebenzisa i-plug-in ye-AMP esuka ku-amp-cloud.de, ngaphandle kwalokho i-plugin ayifakiwe kahle futhi kufanele uphinde uhambe ngezinyathelo ezingenhla:

  • www.DeineDomain.de/amp/amp.php
    (Vele kufanele ungene esikhundleni se-www.yourdomain.de ngekheli lewebhusayithi yakho)

Isinyathelo-4: faka ithegi ye-AMPHTML!

Ekugcineni, faka phakathi ukusunduza isisekelo ngasinye , ofuna ukusinikeza inguqulo ye-AMP, usebenzisa okunye kokulandelayo i- <link rel = "amphtml"> - usuku esigabeni se- <head> sesisekelo esihambisanayo.

  • Inguqulo 1:

    <link rel = "amphtml" href = "http: // www.DeineDomain.de /amp/amp.php?url= IhrArtikelURL " />
    • Shintshanisa ingxenye ethi "http://" ngokuthi "https: //" uma usebenzisa i-HTTPS kuwebhusayithi yakho
    • Miselela ingxenye ethi "www.yourdomain.de" ngesizinda sewebhusayithi yakho
    • Miselela ingxenye ethi "I-URL Yakho Yesindatshana" nge- UTF8 encoded URL yekhasi eliyisihluthulelo lapho ufaka khona ithegi ye-AMPHTML (incl. "Http: //" noma "https: //")

      Ukufaka i-URL ngendlela efanele, ungasebenzisa okufakwayo oku-inthanethi kwamahhala oku-inthanethi okulandelayo, isibonelo: https://www.url-encode-online.rocks/

      Isibonelo se-URL efakiwe ye-UTF-8:
      https% 3A% 2F% 2Fwww.DeineDomain.de% 2FDeinPfad% 2FDeineDatei.php% 3Fparameter% 3DS% C3% BC% C3% 9F% 26sprache% 3DDE

      Isibonelo se-URL enekhodi ye-UTF-8:
      https://www.DeineDomain.de/DeinPfad/DeineDatei.php?parameter=Süß&sprache=DE

  • Okuhlukile 2:

    <link rel="amphtml" href=" http:// ".$_SERVER['HTTP_HOST']."/amp/amp.php?url=".urlencode(" http:// ".$_SERVER['HTTP_HOST '].$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."")."" />
    • Uma usebenzisa i-HTTPS kuwebhusayithi yakho, shintsha izingxenye ezimbili "http: //" nge "https: //"

Isibonelo sekhodi ye-AMP PHP


code
<?php echo " <!DOCTYPE html> <html> <head> <title> Isihloko sakho se-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> Ikhodi yomthombo womzimba wakho ... </body> </html> ;" ?>

Kungani usebenzisa i-plugin ye-AMP PHP?


power

I-AMP esemthethweni ye-plugin ye-PHP evela ku-amp-cloud.de isebenzisa ama-Accelerated Mobile Pages (AMP) kumawebhusayithi wakho we-PHP, ngqo ngaphansi komphathi wakho, njengoba kunconywe imihlahlandlela yokusingathwa kwe-AMP yakwaGoogle!


Isikhangiso