PHP AMP Plugin - Hoʻoiho & kuhikuhi

Me ka AMP no PHP kuʻina hiki iā ʻoe ke maʻalahi, holoʻokoʻa loa, e hana i nā ʻaoʻao Google AMP no kāu mau pūnaewele.

Hoʻopau i kāu pūnaewele PHP no nā polokalamu kelepona a me ka Google Mobile First Index me ka ʻole o ka papahana ʻana i kāu mana AMPHTML ponoʻī no kēlā me kēia ʻaoʻao.

Hōʻoia iā: hoʻouka. Hoʻoikaika. Piha!


Hoʻolaha

E hoʻouka i ka plugin AMP PHP


description

Kahi kihi ma mua o kou hoʻomaka ʻana e hoʻouka i ka plug-in PHP-AMP: No kekahi mau hanana CMS, hāʻawi ʻo amp-cloud.de i nā plugins Google AMP kūikawā i ʻoi aku ka maʻalahi o ka hoʻouka a me ka hoʻokele. - Ma ke ʻano he koho ʻē aʻe i ka "AMP no ka plug-in" PHP , hiki i kekahi o nā plug-in ʻo Google AMP e makemake nei iā ʻoe.


ʻAnuʻu-1: Hoʻoiho iā "AMP no PHP Plugin"

Hoʻoiho i ka mana "AMP no PHP Plugin" i kēia manawa ma ke ʻano he faila ZIP mai ka loulou hoʻoiho aʻe. - Aia ka waihona ZIP i kahi waihona i kapa ʻia "amp" i loaʻa nā faila āpau e pono ai e hoʻouka a hoʻohana i ka plug-in AMP.


ʻAnuʻu-2: E unuhi i ka "AMP no PHP Plugin" -ZIP-faila

Wehe / unuhi i ka faila ZIP i hoʻoiho ʻia.

  • Ma hope o ka hemo ʻana / unuhi ʻana iā ʻoe i kēia manawa he "folder" me ka inoa "/ amp /" i loaʻa nā faila kuʻina PHP-AMP.

ʻAnuʻu-3: E mālama i nā faila plugin PHP ma ka pūnaewele pūnaewele

Hoʻouka i ka waihona unzipped me ka inoa "/ amp /" i ka papa kuhikuhi kumu o kāu pūnaewele pūnaewele i hiki i ke kiʻi i kāu pūnaewele ma lalo o ka URL aʻe:

  • www.DeineDomain.de/amp/

No ka hoʻāʻo ʻana inā mālama pono ʻia ka waihona ma kāu pūnaewele pūnaewele, e kāhea wale i kēia URL - Inā pololei ke kau ʻana, ʻike ʻoe i kahi leka e haʻi iā ʻoe e hoʻohana ana kāu pūnaewele i ka plug-in AMP mai amp-cloud.de, i ʻole ʻaʻole hoʻokomo pono ʻia ka plugin a pono ʻoe e hele ma waena o nā ʻanuʻu i luna.

  • www.DeineDomain.de/amp/amp.php
    (ʻOiaʻiʻo pono ʻoe e pani www.yourdomain.de me ka helu wahi o kāu pūnaewele)

ʻAnuʻu-4: e hoʻokomo i ka tag AMPHTML!

ʻO ka hope, e hoʻokomo i ka hoʻokuke ʻana i kēlā me kēia kumu, kahi āu e makemake ai e hāʻawi i ka mana AMP, me ka hoʻohana ʻana i kekahi o kēia mau ʻano a <link rel = "amphtml"> - he ma ka ʻāpana <head> o ka waihona pili.

  • Mana 1:

    <link rel = "amphtml" href = "http: // www.DeineDomain.de /amp/amp.php?url= IhrArtikelURL " />
    • E kuapo i ka ʻāpana "http: //" me "https: //" inā ʻoe e hoʻohana nei iā HTTPS ma kāu pūnaewele
    • E kuapo i ka ʻāpana "www.yourdomain.de" me ke kāʻei o kāu pūnaewele
    • E kuapo i ka ʻāpana "Kou ʻatikala URL" me kahi URL hoʻopili ʻia ʻo UTF8 o ka ʻaoʻao ʻaoʻao kahi āu e hoʻokomo ai i ka tag AMPHTML (hoʻohui pū ʻia. "Http: //" a i ʻole "https: //")

      No ka hoʻopili kūpono ʻana i kahi URL, hiki iā ʻoe ke hoʻohana i ka encoder URL pūnaewele manuahi aʻe, e laʻa me: https://www.url-encode-online.rocks/

      ʻO kahi laʻana no kahi UTF-8 encode URL:
      https% 3A% 2F% 2Fwww.DeineDomain.de% 2FDeinPfad% 2FDeineDatei.php% 3Fparameter% 3DS% C3% BC% C3% 9F% 26sprache% 3DDE

      ʻO kahi laʻana o kahi UTF-8 decoded URL:
      https://www.DeineDomain.de/DeinPfad/DeineDatei.php?parameter=Süß&sprache=DE

  • Nāʻano 2:

    <link rel="amphtml" href=" http:// ".$_SERVER['HTTP_HOST']."/amp/amp.php?url=".urlencode(" http:// ".$_SERVER['HTTP_HOST" '].$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."")."" />
    • Inā hoʻohana ʻoe i ka HTTPS ma kāu pūnaewele, e hoʻololi i nā ʻāpana ʻelua "http: //" me "https: //"

ʻO ka laʻana code AMP PHP


code
<?php echo " <!DOCTYPE html> <html> <head> <title> Kou inoa 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> ʻO ke code kumu kumu o kou kino ... </body> </html> ;" ?>

No ke aha e hoʻohana ai i ka plugin AMP PHP?


power

ʻO ka AMP official no ka PHP plugin mai amp-cloud.de e hoʻoulu i nā ʻaoʻao Mobile i hōʻeleu ʻia (AMP) ma kāu pūnaewele PHP ponoʻī, ma lalo pono o kāu mea ponoʻī ponoʻī, e like me ka ʻōlelo a nā alakaʻi alakaʻi AMP o Google.


Hoʻolaha