PHP AMP Plugin - Rub & Cov Lus Qhia

Nrog AMP rau PHP plugin koj tuaj yeem yooj yim, ua tiav, tsim Google AMP nplooj ntawv rau koj lub vev xaib.

Ua kom zoo dua koj lub vev xaib PHP rau cov khoom siv mobile thiab Google Txawb Thawj Qhov Ntsuas yam tsis tas yuav teeb tsa koj tus kheej AMPHTML version rau txhua ntawm koj nplooj ntawv!

Sim nws tawm: Install. Qhib qhib. Npaj txhij!


Kev tshaj tawm

Nruab AMP PHP plugin


description

Cov lus qhia ua ntej koj pib txhim kho PHP-AMP plug-in: Rau qee qhov kev daws teeb meem CMS, amp-cloud.de muaj tshwj xeeb Google AMP plug-ins uas yooj yim dua rau nruab thiab tswj! - Raws li lwm txoj hauv kev rau "AMP rau PHP plug-in" , ib qho ntawm Google AMP plug-ins hauv qab no tuaj yeem txaus siab rau koj:


Kauj ruam-1: Rub tawm "AMP rau PHP Plugin"

Rub tawm tam sim no "AMP rau PHP Plugin" version ua ZIP cov ntaub ntawv los ntawm cov kab ntawv txuas hauv qab no. - ZIP cov ntaub ntawv muaj daim nplaub tshev hu ua "amp" uas muaj txhua cov ntaub ntawv xav tau los teeb tsa thiab siv AMP plug-in.


Kauj ruam 2: Extract "AMP rau PHP Plugin" -ZIP-file

Unzip / rho tawm cov ntawv ZIP uas tau rub tawm.

  • Tom qab tsis tsim / rho tawm koj yuav tsum tam sim no muaj "nplaub tshev" nrog lub npe "/ amp /" nyob rau hauv uas PHP-AMP plugin cov ntaub ntawv nyob.

Kauj ruam-3: Tseg PHP plugin cov ntaub ntawv ntawm lub web server

Rub tawm lub nplaub tshev unzipped nrog lub npe " / amp /" rau hauv cov hauv paus hauv paus ntawm koj lub vev xaib kom cov nplaub tshev tuaj yeem mus txog ntawm koj lub vev xaib raws li URL hauv qab no:

  • www.DeineDomain.de/amp/

Txhawm rau kuaj seb daim nplaub tshev raug khaws cia ntawm koj lub web server, tsuas yog hu rau qhov URL nram qab no - Yog tias kev teeb tsa tsis raug, koj yuav tsum pom ib tsab xov uas qhia koj tias koj lub vev xaib siv AMP ntsaws los ntawm amp-cloud.de, txwv tsis pub lub plugin tsis raug ntsia kom raug thiab koj yuav tsum mus dhau cov theem saum toj no dua:

  • www.DeineDomain.de/amp/amp.php
    (Tau kawg koj yuav tsum hloov www.yourdomain.de nrog qhov chaw nyob ntawm koj lub vev xaib)

Kauj ruam-4: ntxig rau AMPHTML tag!

Thaum kawg, suav nrog thawb txhua lub hauv paus, rau qhov uas koj xav muab AMP version, siv ib qho ntawm cov sib txawv hauv qab no ib tug <link rel = "amphtml"> - ib hnub hauv ntu <taub hau> ntawm cov hauv paus coj.

  • Version 1:

    <link rel = "amphtml" href = "http: // www.DeineDomain.de /amp/amp.php?url= IhrArtikelURL " />
    • Hloov lub "http: //" ib feem nrog "https: //" yog tias koj siv HTTPS ntawm koj lub vev xaib
    • Hloov pauv ntu "www.yourdomain.de" nrog tus sau ntawm koj lub vev xaib
    • Hloov qhov "Koj Tshooj URL" nrog UTF8 encoded URL ntawm nplooj ntawv txuas ntxiv uas koj suav nrog AMPHTML lossis (xws li "http: //" lossis "https: //")

      Txhawm rau kev txheeb xyuas qhov URL kom tsim nyog, koj tuaj yeem siv cov chaw nyob online dawb URL encoder, piv txwv: https://www.url-encode-online.rocks/

      Piv txwv rau UTF-8 encoded URL:
      https% 3A% 2F% 2Fwww.DeineDomain.de% 2FDeinPfad% 2FDeineDatei.php% 3Fparameter% 3DS% C3% BC% C3% 9F% 26sprache% 3DDE

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

  • Lwm Yam 2:

    <link rel="amphtml" href=" http:// ".$_SERVER['HTTP_HOST']."/amp/amp.php?url=".urlencode(" http:// ".$_SERVER['HTTP_HOST']. '].$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."")"" />
    • Yog tias koj siv HTTPS ntawm koj lub vev xaib, hloov ob ntu "http: //" nrog "https: //"

Piv txwv AMP PHP code


code
<?php echo " <!DOCTYPE html> <html> <head> <title> Koj lub npe 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> Koj lub cev kev cai ... </body> </html> ;" ?>

Vim li cas ho siv AMP PHP plugin?


power

Tus nom AMP rau PHP plugin los ntawm amp-cloud.de ua kom nrawm Cov Nplooj Ntawv Txawb (AMP) ntawm koj tus kheej lub vev xaib PHP, ncaj qha rau hauv koj tus tswv tsev, raws li tau pom zoo los ntawm Google AMP tus txheej txheem qhia!


Kev tshaj tawm