Ngwa mgbakwunye PHP AMP - Budata & Ntuziaka

Site na AMP maka ngwa mgbakwunye PHP ị nwere ike mfe, kpamkpam na -akpaghị aka, mepụta ibe Google AMP maka weebụsaịtị gị.

Mee ka ebe nrụọrụ weebụ PHP gị kachasị mma maka ngwaọrụ mkpanaka yana Google Mobile First Index na- enweghị ịhazi usoro AMPHflix gị maka ibe gị!

Nwalee ya: Wụnye. Mee ọ rụọ ọrụ. Emechara!


Mgbasa ozi

Wụnye ngwa mgbakwunye AMP PHP


description

Ntuziaka tupu ịmalite ịwụnye nkwụnye PHP-AMP: Maka ụfọdụ ngwọta CMS, amp-cloud.de na-enye Google plug-ins Google AMP pụrụ iche nke dị mfe ịwụnye ma jikwaa! - Dịka ihe ọzọ na "AMP maka nkwụnye PHP" , otu n'ime ihe nkwụnye Google AMP ndị a nwere ike ịmasị gị:


Kwụpụ-1: Budata "AMP maka ngwa mgbakwunye PHP"

Budata "AMP maka ngwa mgbakwunye PHP" ugbu a dị ka faịlụ ZIP site na njikọ njikọ nbudata. - Faịlụ ZIP nwere folda akpọrọ "amp" nke nwere faịlụ niile achọrọ iji wụnye ma jiri nkwụnye AMP.


Nzọụkwụ-2: Wepụ "AMP maka ngwa mgbakwunye PHP" -ZIP-file

Wepụ / wepụ faịlụ ZIP ebudatara.

  • Mgbe ịtọsịrị / wepu ya, ị ga - enwe "folda" nwere aha "/ amp /" ebe faịlụ nkwụnye PHP-AMP dị.

Nzọụkwụ-3: Chekwaa faịlụ mgbakwunye PHP na sava weebụ

Bulite folda ahụ na - emegheghị aha ya "/ amp /" n'ime ndekọ mgbọrọgwụ nke sava weebụ gị ka folda ahụ nwee ike iru na weebụsaịtị gị n'okpuru URL ndị a:

  • www.DeineDomain.de/amp/

Iji nwalee ma echekwara folda ahụ na sava weebụ gị, kpọọ URL na - esonụ - Ọ bụrụ na nrụnye ahụ ziri ezi, ị ga - ahụ ozi ga - agwa gị na webụsaịtị gị na - eji nkwụnye AMP site na amp-cloud.de, ma ọ bụghị na ngwa mgbakwunye adịghị arụnyere n'ụzọ ziri ezi na ị kwesịrị ị na-aga site n'elu nzọụkwụ ọzọ:

  • www.DeineDomain.de/amp/amp.php
    (N'ezie ị ga -eji adreesị weebụsaịtị gị dochie www.yourdomain.de)

Kwụpụ-4: tinye mkpado AMPHTML!

N'ikpeazụ, gụnyere ịkwanye ntọala nke ọ bụla , nke ịchọrọ ịnye ụdị AMP, na -eji otu n'ime ụdị ndị a a <njikọ rel = "amphtml"> - otu ụbọchị na <isi> ngalaba nke ntọala kwekọrọ.

  • Versiondị 1:

    <njikọ rel = "amphtml" href = "http: // www.DeineDomain.de /amp/amp.php?url= IhrArtikelURL " />
    • Dochie "http: //" akụkụ na "https: //" ma ọ bụrụ na ị na -eji HTTPS na weebụsaịtị gị
    • Dochie akụkụ "www.yourdomain.de" na ngalaba nke ebe nrụọrụ weebụ gị
    • Dochie akụkụ "Edemede Gị Nkeji edemede" na UTF8 ejiri koodu URL rụọ ọrụ nke obere subpage nke ị gụnyere akara AMPHflix (gụnyere. "Http: //" ma ọ bụ "https: //")

      Iji zoo URL nke ọma, ị nwere ike iji ihe ngbanwe URL ọnlaịnụ n'efu, dịka ọmụmaatụ: https://www.url-encode-online.rocks/

      Ihe Nlereanya maka UTF-8 koodu URL:
      https% 3A% 2F% 2Fwww.DeineDomain.de% 2FDeinPfad% 2FDeineDatei.php% 3Fparameter% 3DS% C3% BC% C3% 9F% 26sprache% 3DDE

      Ihe Nlereanya maka UTF-8 decoded URL:
      https://www.DeineDomain.de/DeinPfad/DeineDatei.php?parameter=Süß&sprache=DE

  • Dị iche 2:

    <link rel="amphtml" href=" http:// ".$_SERVER['HTTP_HOST']."/amp/amp.php?url=".urlencode(" http:// ".$_SERVER['HTTP_HOST'] '].$_SERVER['PHP_SELF']"?".$_SERVER['QUERY_STRING']."")."" />
    • Ọ bụrụ na iji HTTPS na webụsaịtị gị, dochie akụkụ abụọ "http: //" na "https: //"

AMP PHP koodu ihe omuma


code
<?php echo " <!DOCTYPE html> <html> <head> <title> Meta aha gị ... </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> Koodu isi aru gi ... </body> </html> ;" ?>

Kedu ihe iji jiri ngwa mgbakwunye AMP PHP?


power

AMP nke ọrụ gọọmentị maka ngwa mgbakwunye PHP sitere na amp-cloud.de na-arụ ọrụ Peeji Mepụta Accelerated (AMP) na weebụsaịtị PHP gị, n'okpuru onye nwe gị, dịka ntuziaka ndị ọbịa Google AMP kwadoro!


Mgbasa ozi