Create dynamic news site optimized for Google

3

I want to create pages on a specific news site and initially thought about storing news information (title, subject, news text, etc.) in a database. As soon as my noticia.aspx page was accessed, I would search the news content in the database.

But this is not good practice for Google's search engines to find my page. I also noticed that sites like Uol, Globo.com present the news page with the extension "HTML", as shown below:

  

link

How do these sites manage this news? Do they generate static pages? How can I generate this content dynamically and be visible to Google?

    
asked by anonymous 25.09.2015 / 22:14

2 answers

6

Where did you get the information that this is not a good practice? There is no problem in doing this. All sites do. The search engine accesses the page as if it were a browser.

How page generation works

Just do not say "if the browser sees the content the search engine will also see" because this is not an absolute truth when the content is assembled through JavaScript.

There is the myth that this is solved today, but it is not true. The situation that was zero capability of the mechanisms understand JS, has improved, but still has ground. And yet it has its own techniques to achieve a reasonable result in some mechanisms. Not all. While only Google really counts.

Any page generated on-the-fly on the server will be viewed normally without any problem. The only reason to generate static pages would be to optimize the server's capacity since you would generate a page once and then only access. But I've seen people abusing this and getting the opposite result.

When the page is dynamic it is generated every time it is requested. Unless you use cache. And of course the general page cache only works if the page never changes, or at least changes little, which is not so common. It is common for each page requested to have a difference to the previous one, for publicity, news, personalization or another reason. Dynamic pages generate more load on the server, but in most cases this is not a problem. And the various cache levels will help mitigate a very heavy load.

The browser cache is also your friend.

The problem is on these pages SPA . In this case generation is done in the browser, by JS. The search engine can simulate some executions and generate content, but there are several situations that this is impractical.

Page name extension

When you generate a page you can by whatever extension you want. It is not mandatory to be .aspx , or .php or other extension for it to be processed.

If you configure the HTTP server for an extension to be processed, every time something with this extension is configured to call, it will trigger a designated processor, which can be an application or interpreter of a language. You can set up .html to be processed as an ASP.Net application if you want. It has been agreed that the .html extension is used for static pages, but nothing prevents it from being this.

Friendly URL

In addition, you can use a friendly URL ( another question ) that turns the URL into a route that internally in the server calls some application or piece of it in specific. That is, you disguise the application's actual address for something that's easier for people to read, and search engines identify the content. This is a very common technique that can be configured on the HTTP server (Apache, IIS, etc.) or within the application . I particularly prefer it within the application.

Conclusion

Do not worry about generating dynamic pages. And when this is creating load problems, start seeing techniques to reduce this. But not before.

This is general information. When you have more specific questions open more specific questions.

    
26.09.2015 / 23:13
2
  

The @bigown response answers all the theoretical part behind, I'll just add a practical part of how to do this in , since the AP said that is what it's using .

To add the extension .html on your pages is not necessary to create static pages, simply use the routing engine Asp.NET MVC for it.

For example, if you are looking for news, just do this on your controller:

[Route("{categoria}/noticia/{ano}/{mes}/{titulo}.html")]
public ActionResult Detalhes(string ano, string mes, string titulo)
{
    var noticia = db.Noticias.FirstOrDefatul(´/*where aqui*/);

    return View(noticia);
}

And in your file Web.config add this line:

<system.webServer>
        <handlers>
            <add name="HtmlFileHandler" path="*.html" verb="GET" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
        </handlers>
    </system.webServer>

Once this is done, will be generating URL's %% with the extension .html , but without having static pages, as in the example cited in the question.

  

link

    
14.06.2016 / 16:46