Search code examples
phplaravelmodel-view-controllersearch-engine

How do search engines index MVC pages?


Manually you can make PHP pages in your directory. e.g.

  • 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. e.g.

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?


Solution

  • 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.