Pulogalamu ya PHP AMP - Tsitsani & Malangizo

Ndi pulogalamu yowonjezera ya AMP ya PHP mutha mosavuta, mwadongosolo, ndikupanga masamba a Google AMP amalo patsamba lanu.

Konzani tsamba lanu la PHP pazida zamagetsi ndi Google Mobile First Index popanda kupanga pulogalamu yanu ya AMPHTML patsamba lanu lililonse!

Yesani: Ikani. Yambitsani. Zatha!


Chidziwitso

Ikani pulogalamu yowonjezera ya AMP PHP


description

Malangizo musanayambe kukhazikitsa pulogalamu yolumikizira PHP-AMP: Pa mayankho ena a CMS, amp-cloud.de imapereka ma plug-ins apadera a Google AMP omwe ndiosavuta kukhazikitsa ndikuwongolera! - Mosiyana ndi "AMP for PHP plug-in" , imodzi mwama plug-ins a Google AMP ikhoza kukhala yosangalatsa kwa inu:


Gawo 1: Tsitsani "AMP for PHP Plugin"

Tsitsani mtundu wapano wa "AMP for PHP Plugin" ngati fayilo ya ZIP kuchokera pa ulalo wotsatirawu. - Fayilo ya ZIP ili ndi chikwatu chotchedwa "amp" chomwe chimakhala ndi mafayilo onse ofunikira kukhazikitsa ndikugwiritsa ntchito plug-in ya AMP.


Gawo 2: Chotsani "AMP for PHP Plugin" -ZIP-file

Tsegulani / tulutsani fayilo ya ZIP yojambulidwa.

  • Mukamasula / kutulutsa tsopano muyenera kukhala ndi "chikwatu" chokhala ndi dzina loti "/ amp /" momwe muli mafayilo a mapulagini a PHP-AMP.

Gawo 3: Sungani mafayilo a plugin a PHP pa intaneti

Kwezani chikwatu chosatulutsidwa ndi dzina "/ amp /" mu chikwatu cha seva yanu kuti fodayo ikwaniritsidwe patsamba lanu pansi pa ulalowu:

  • www.DeineDomain.de/amp/

Kuti muwone ngati fodayo yasungidwa bwino pa seva yanu, ingoyimbani ulalo wotsatirawu - Ngati kuyika kuli kolondola, muyenera kuwona uthenga womwe umakuwuzani kuti tsamba lanu limagwiritsa ntchito plug-in ya AMP kuchokera amp-cloud.de, apo ayi pulogalamu yowonjezera siyimayikidwa molondola ndipo muyenera kuyambiranso izi:

  • www.DeineDomain.de/amp/amp.php
    (Zachidziwikire muyenera kusinthitsa www.yourdomain.de ndi adilesi ya tsamba lanu)

Gawo 4: ikani chizindikiro cha AMPHTML!

Pomaliza, phatikizani kukankha chilichonse, chomwe mukufuna kupereka mtundu wa AMP, pogwiritsa ntchito chimodzi mwanjira zotsatirazi <link rel = "amphtml"> - tsiku limodzi mu <mutu> gawo loyambira.

  • Mtundu 1:

    <link rel = "amphtml" href = "http: // www.DeineDomain.de /amp/amp.php?url= IhrArtikelURL " />
    • Sinthanitsani "http: //" gawo ndi "https: //" ngati mukugwiritsa ntchito HTTPS patsamba lanu
    • Sinthani gawo "www.yourdomain.de" ndi tsamba lanu
    • Sinthanitsani gawolo "URL Yanu Yakale" ndi UTF8 yolembetsedwa mu URL ya tsambalo lomwe mumaphatikizira AMPHTML (kuphatikiza. "Http: //" kapena "https: //")

      Kuti muyike ulalo moyenera, mutha kugwiritsa ntchito encoder yaulere yapaintaneti iyi, mwachitsanzo: https://www.url-encode-online.rocks/

      Chitsanzo cha ulalo wotsekedwa wa UTF-8:
      Chiwerengero:

      Chitsanzo cha ulalo wosimbidwa wa UTF-8:
      https://www.DeineDomain.de/DeinPfad/DeineDatei.php?parameter=Süß&sprache=DE

  • Chosiyanasiyana 2:

    <link rel="amphtml" href=" http:// ".$_SERVER['HTTP_HOST']."/amp/amp.php?url=".urlencode(" http:// ".$_SERVER['HTTP_HOST '].$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."")."" />
    • Ngati mumagwiritsa ntchito HTTPS patsamba lanu, sinthanitsani magawo awiriwo "http: //" ndi "https: //"

Chitsanzo cha code ya AMP PHP


code
<?php echo " <!DOCTYPE html> <html> <head> <title> Mutu wanu wa 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> Khodi yanu yamagetsi ... </body> </html> ;" ?>

Chifukwa chiyani mugwiritse ntchito pulogalamu ya AMP PHP?


power

AMP yovomerezeka ya PHP yochokera ku amp-cloud.de imathandizira Masamba Amtundu Wofulumira (AMP) pamawebusayiti anu a PHP, mwachindunji pansi pa omwe mumayang'anira, malinga ndi malangizo a Google a AMP!


Chidziwitso