简体   繁体   中英

How do search engines index MVC pages?

Manually you can make PHP pages in your directory. eg

  • Index.php
  • About.php
  • Contact.php

But with PHP frameworks like Laravel the pages do not exist in a file, they are in the database and are called when the user visits the page. eg

If a person visits http://mywebsite.com/contact , the framework will look in the database for a page named 'contact' then output it to a user.

But how does Google (or other search engines) find those pages if they only exist in the database?

Google can index these fine as they are "server-side" generated. Files do not need to exist for Google to be able to index them, just exist at the server-side level.

Where Google has issues indexing is if your site is "client-side" based and uses something like AJAX to pull the content into the browser. A search engine spider can't execute JavaScript so they never find the content. However, Google has defined some guidelines for people to get this content indexed in their Web Masters Guide .

You have a static website address www.domain.com and that is real so once google come to know that there is a website named www.domain.com it will visit the site, now that google crawler is on your website it will look out for the links available on the home page of www.domain.com and hence they will be crawled. Thats simple

  1. In Laravel, pages DO NOT exist in database, although they might be dynamically generated.
  2. As pointed @expodax , Google will index LINKS for your web app, and links (URIs) are geneated in accordance with your routes.php file (found in app/Http/routes.php ) In essence, Google will index links / URIs available for the end user, it DOES NOT depend upon how you've organized files in your web app.

For detailed documentation about Routes in Laravel (how they can be generated or used) please check this. http://laravel.com/docs/5.0/routing

A sitemap is a file where you can list the web pages of your site to tell Google and other search engines about the organization of your site content. Search engine web crawlers like Googlebot read this file to more intelligently crawl your site. more info

If you want to generate a sitemap for your laravel application you can do it manually or you can use a package like this: https://github.com/RoumenDamianoff/laravel-sitemap

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM