Mono PHP AMP - Tikiake me nga Tohutohu

Ma te mono AMP mo PHP ka taea e koe te hanga i nga wharangi AMP Google mo o paetukutuku.

Arotakehia to paetukutuku PHP mo nga taputapu waea me te Tiwhikete Tuatahi Tuatahi a Google me te kore e whakamahere i to ake putanga AMPHTML mo ia whaarangi!

Whakamatauhia: Whakauruhia. Whakahohe. Kua Oti!


Panui

Whakauruhia te tohu AMP PHP


description

He tohu i mua i to tiimata ki te whakauru i te taapiri whakauru PHP-AMP: Mo etahi whakataunga CMS, amp-cloud.de he tuku i nga taapiri Google AMP motuhake he maamaa ake ki te whakauru me te whakahaere! - Hei whakakapi mo te "AMP mo te mono-mai PHP" , ko tetahi o nga mono-mai a Google AMP e whai ake nei ka pai ki a koe:


Hipanga-1: Tangohia te "AMP mo te Mono PHP"

Tangohia te putanga "AMP mo te Mono PHP" inaianei hei konae ZIP mai i te hononga tango e whai ake nei. - Kei roto i te konae ZIP tetahi kōpaki e kiia ana ko "amp" kei roto katoa nga konae hei whakauru me te whakamahi i te taapiri-a AMP.


Hipanga-2: Unuhia te "AMP mo te Mono PHP" -ZIP-konae

Wewetehia / tangohia te konae ZIP kua tangohia.

  • I muri i te wetewete / tango ka whai koe i tetahi "kōpaki" me te ingoa "/ amp /" kei reira nga konae whakauru-a-hono PHP-AMP.

Hipanga-3: Tiakina nga konae mono PHP ki runga i te tūmau tukutuku

Tukuna te kopae kua korehia me te ingoa "/ amp /" ki te raarangi pakiaka o to kaituku paetukutuku kia tae atu ai te kōpaki ki to paetukutuku i raro i te URL e whai ake nei:

  • www.DeineDomain.de/amp/

Hei whakamatautau he tika te penapena o te kopaki i runga i to kaituku paetukutuku, karanga noa i te URL e whai ake nei - Mena he tika te whakauru, me kite koe i tetahi korero e kii atu ana ka whakamahia e to paetukutuku te whakauru-AMP mai i amp-cloud.de, ki te kore e tika te whakauru o te monomai ana me haere ano koe ki nga huarahi i runga ake nei:

  • www.DeineDomain.de/amp/amp.php
    (Ae ra me whakakapi koe www.yourdomain.de me te wahitau o to paetukutuku)

Hipanga-4: whakauruhia te tohu AMPHTML!

I te mutunga, whakauruhia te akiaki i ia turanga, e hiahia ana koe ki te whakarato i te putanga AMP, ma te whakamahi i tetahi o nga momo e whai ake nei he <link rel = "amphtml"> - he ra i te waahanga <head> o te turanga e hangai ana.

  • Putanga 1:

    <link rel = "amphtml" href = "http: // www.DeineDomain.de /amp/amp.php?url= IhrArtikelURL " />
    • Whakakapihia te waahanga "http: //" me te "https: //" mena kei te whakamahi koe i te HTTPS i runga i to paetukutuku
    • Whakakapihia te waahanga "www.yourdomain.de" me te rohe o to paetukutuku
    • Whakakapihia te waahanga "To Tuhinga URL" me te UTF8 whakawaeheretia URL o ia whaarangi waahanga ka whakauruhia e koe te tohu AMPHTML (tae atu. "Http: //" pe "https: //")

      Hei whakawaehere i te URL ma te tika, ka taea e koe te whakamahi i te encoder URL koreutu e whai ake nei, hei tauira: https://www.url-encode-online.rocks/

      He tauira mo te UTF-8 URL whakawaeheretia:
      https% 3A% 2F% 2Fwww.DeineDomain.de% 2FDeinPfad% 2FDeineDatei.php% 3Fparameter% 3DS% C3% BC% C3% 9F% 26sprache% 3DDE

      He tauira mo te UTF-8 URL wetekina:
      https://www.DeineDomain.de/DeinPfad/DeineDatei.php?parameter=Süß&sprache=DE

  • Momo 2:

    <link rel = "amphtml" href = " http: // ". $ _ SERVER ['HTTP_HOST']. "/ amp / amp.php? url =". urlencode (" http: // ". $ _ SERVER [ 'HTTP_HOST']. $ _ SERVER ['PHP_SELF']. "?". $ _ SERVER ['QUERY_STRING']. ""). "" />
    • Mena ka whakamahia e koe te HTTPS ki to paetukutuku, whakakapihia nga waahanga e rua "http: //" me te "https: //"

Tauira waehere waehere AMP PHP


code
<?php echo " <!DOCTYPE html> <html> <head> <title> To taitara 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> Dein Body-Quelltext... </body> </html> ;" ?>

He aha te whakamahi i te monomai AMP PHP?


power

Ko te AMP mana mo te monomai PHP mai i te amp-cloud.de ka whakahohe i nga Wharangi Waea Whakatere (AMP) i runga i o paetukutuku PHP, kei raro i to kaihautu, pera me nga tohutohu a te kaihauturu AMP a Google!


Panui