Search code examples
node.jsgruntjsseoprerender

I made a website using Yeoman/Grunt with Node.js just to build my application, how do I use the prerender or seo4ajax and index it?


I made a website using Yeoman; grunt , generator-angular, $routeParams ... with Node.js just to build my application , how do I use the prerenderor seo4ajax and index it?

Using Node.js as an application server could set like this: Run this on the command line: $ npm install prerender-node --save

And when you set up your express app...: app.use(require('prerender-node'));

But, I use Node.js only to build my application, i do not have express this app, how do I install and configure nginx (I use hosting Godaddy ) to get index the content of my site?


Solution

  • Google provides some tools that make content indexing in ajax , now my site is appearing in search engine/research.

    Go to: https://www.google.com/webmasters/tools/googlebot-fetch?hl=
    Add a site , then go to trace > Fetch as Google and enter the pages you want to render and then index. There are many other excellent tools that site to assist us in indexing content in Ajax .

    More info: https://support.google.com/webmasters/answer/6066467?hl=en

    Yannick 's SEO4Ajax provided these modules to .htaccess and social networks functioned: Replace yousite with the name of your domain , replace put you token by his token (to get the token register at: seo4ajax.com ) then copy and paste in your .htaccess.

    <IfModule mod_headers.c>
    RequestHeader set Host "api.seo4ajax.com"
    </IfModule>
    
    <ifModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    Options +FollowSymLinks
    # Redirect yousite.com to www.yousite.com
    RewriteCond %{HTTP_HOST} ^yousite\.com [NC]
    RewriteRule ^(.*) http://www.yousite.com/$1 [L,R=301]
    
    <IfModule mod_proxy_http.c>
    # If requested with the _escaped_fragment_ query parameter, proxify
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !(index.html) [NC]
    RewriteCond %{QUERY_STRING} _escaped_fragment_= [NC]
    RewriteRule .* - [E=PROXIFY:true]
    
    # If requested by a bot that does not support the specification, proxify
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !(index.html) [NC]
    RewriteCond %{HTTP_USER_AGENT}  !(google.*bot|bing|msnbot|yandexbot|pinterest.*ios|mail\.ru) [NC]
    RewriteCond %{HTTP_USER_AGENT}  (bot|crawler|spider|archiver|pinterest|facebookexternalhit|flipboardproxy) [NC]
    RewriteRule .* - [E=PROXIFY:true]
    
    # Proxification to SEO4Ajax
    RequestHeader set Host "api.seo4ajax.com" env=PROXIFY
    RewriteCond  %{ENV:PROXIFY}  true
    RewriteRule ^(.*)$ http://api.seo4ajax.com/put you token/$1 [P,QSA,L]
    </ifModule>
    # html5 pushstate enable
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    
    RewriteRule ^ index.html [L]
    </ifModule>
    

    Pass the information from your array for schemas and meta property . Put that schemas and meta property in their views.

    <div ng-repeat="item in grupo">
       <!-- Schemas -->
       <div span itemscope itemtype="http://schema.org/Article"></span>
       <span itemprop="name" content="{{item.title}}"></span>
    
       <span itemprop="description" content="{{item.description}}"></span>
    
       <span itemprop="articleSection" content="Humor"></span>
    
       <span itemprop="image" content="http://www.yousite.com/images/{{item.img}}" ></span>
       </div>
       <!-- End - Schemas -->
    
       <!-- Meta property  -->
      <meta property="og:title" content="{{item.title}}" />
      <meta property="og:image" content="http://www.yousite.com/images/{{item.img}}" />
      <meta property="og:description" content="{{item.description}}" />
      <!-- End - Meta property  -->
    </div>