How to add amphtml and canonical links for dynamic page views
P粉515066518
P粉515066518 2024-03-27 23:27:35
0
1
327

I followed this article and this article to optimize my Laravel website Google AMP. My website shows different views for different routes. For example, / will open the index page (after binding multiple views), while the /amp route will point to the amp version of the index page.

According to the AMP documentation, two pages should be linked to each other via canonical and amphtml links, like this:

<link rel="canonical" href="/article.html">
<link rel="amphtml" href="/article.amp.html">

Any ideas on providing these links for Laravel Blade since I don't have the complete .html page. Should I add a route here? For example

<link rel="canonical" href="{{/}}">
<link rel="amphtml" href="{{/amp}}">

P粉515066518
P粉515066518

reply all(1)
P粉668804228

Generate amp pages and non-amp pages... copy the urls from the browser and insert these urls into both links accordingly

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!