PHP AMP Plugin - Dhawunirodha & Mirayiridzo

Iine AMP yePHP plugin unogona nyore, otomatiki, kugadzira Google AMP mapeji emawebhusaiti ako.

Gadziridza yako webhusaiti yePHP kune nhare mbozha uye neGoogle Mobile Yekutanga Index pasina kuita chirongwa chako cheAMPHTML vhezheni yega yega yemapeji ako!

Edza iyo kunze: Isa. Activate. Yapera!


Kushambadzira

Isa iyo AMP PHP plugin


description

Zano usati watanga kuisa iyo PHP-AMP plug-in: Kune dzimwe mhinduro dzeCMS, amp-cloud.de inopa yakakosha maGoogle AMP plug-ins ayo ari nyore kuisa nekugadzirisa! - Seimwe nzira kune "AMP yePHP plug-in" , imwe yeanotevera maGoogle AMP plug-ins inogona kufarira iwe:


Nhanho-1: Dhawunirodha "AMP yePlugin PHP"

Dhawunirodha yazvino "AMP yePHP Plugin" vhezheni seZIP faira kubva pane inotevera download dhawunirodhi. - Iyo Zip faira ine dhairekita inonzi "amp" iyo ine mafaera ese anodikanwa kumisikidza uye kushandisa AMP plug-in.


Nhanho-2: Bvisa iyo "AMP yePHP Plugin" -ZIP-faira

Unzip / bvisa faira reZIP rakadzingwa.

  • Mushure mekuburitsa / kuburitsa iwe unofanirwa kuve ne "folda" ine zita rekuti "/ amp /" mune iyo PHP-AMP ma plug-in mafaira aripo.

Nhanho-3: Sevha PHP plugin mafaera pane webhu server

Isa iyo isina kuvharwa dhairekitori ine zita rekuti "/ amp /" mumidzi dhairekitori rewebhu server yako kuitira kuti dhairekitori riwanikwe pane webhusaiti yako pasi peiyo inotevera URL:

  • www.DeineDomain.de/amp/

Kuti uone kana dura racho rakachengetedzwa zvakanaka pawebhu webhu yako, ingo daidza iyo inotevera URL - Kana iko kuisirwa kuri kwechokwadi, unofanirwa kuona meseji inokuudza kuti webhusaiti yako inoshandisa AMP plug-in kubva amp-cloud.de, zvikasadaro plugin haina kuiswa nenzira kwayo uye iwe unofanirwa kupfuura nematanho ari pamusoro zvakare:

  • www.DeineDomain.de/amp/amp.php
    (Chokwadi unofanirwa kutsiva www.yourdomain.de nekero yewebhusaiti yako)

Nhanho-4: isa iyo AMPHTML tag!

Pakupedzisira, sanganisira kusundidzira base imwe neimwe , iyo yaunoda kupa AMP vhezheni, uchishandisa imwe yeanotevera akasiyana a <link rel = "amphtml"> - zuva mune <head> chikamu cheiyo inoenderana base.

  • Shanduro 1:

    <link rel = "amphtml" href = "http: // www.DeineDomain.de /amp/amp.php?url= IhrArtikelURL " />
    • Chinja "http: //" chikamu ne "https: //" kana uri kushandisa HTTPS pawebhusaiti yako
    • Chinja chikamu "www.yourdomain.de" nechinzvimbo chewebhu webhusaiti
    • Tsiva chikamu "Yako Chinyorwa URL" ne UTF8 yakadzvanywa URL yeiyo yakatarwa subpage iyo iwe yaunosanganisira iyo AMPHTML tag (incl. "Http: //" kana "https: //")

      Kuti unamate URL nenzira kwayo, unogona kushandisa inotevera yemahara URL encoder, semuenzaniso: https://www.url-encode-online.rocks/

      Semuenzaniso weiyo UTF-8 yakanyorwa URL:
      https% 3A% 2F% 2Fwww.DeineDomain.de% 2FDeinPfad% 2FDeineDatei.php% 3Fparameter% 3DS% C3% BC% C3% 9F% 26sprache% 3DDE

      Semuenzaniso we UTF-8 yakatemwa URL:
      https://www.DeineDomain.de/DeinPfad/DeineDatei.php?parameter=Süß&sprache=DE

  • Musiyano 2:

    <link rel="amphtml" href=" http:// ".$_SERVER['HTTP_HOST']."/amp/amp.php?url=".urlencode(" http:// ".$_SERVER['HTTP_HOST '].$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."")."" />
    • Kana iwe ukashandisa HTTPS pawebhusaiti yako, chinja zvikamu zviviri "http: //" na "https: //"

AMP PHP kodhi muenzaniso


code
<?php echo " <!DOCTYPE html> <html> <head> <title> Yako meta zita ... </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> Yako kodhi sosi kodhi ... </body> </html> ;" ?>

Nei uchishandisa AMP PHP plugin?


power

Iyo yepamutemo AMP yePPP plugin kubva kuam-cloud.de inomutsa Accelerated Mobile Mapeji (AMP) pane ako wega mawebhusaiti ePHP, zvakananga pasi peako wega host, sezvakakurudzirwa neGoogle's AMP inomirira nhungamiro!


Kushambadzira