Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Robots and-sitemap - Version 1.0.1


Published on

Introduction to robots.txt and sitemap.xml files.

Published in: Education
  • Be the first to comment

Robots and-sitemap - Version 1.0.1

  1. 1. Robots and SitemapBy Naji El Kotob.Information Technology Consultant_______________________________naji [@] DotNETHeroes.comReview 1.0.1 - 13.Business Intelligence Group BIG SARL
  2. 2. by Naji El KotobOutlines SEO Robots.txt Sitemap.xml Q&A
  3. 3. by Naji El KotobSEO
  4. 4. by Naji El KotobWhat is SEO SEO is short for search engine optimization orsearch engine optimizer. Search engine optimization is a methodology ofstrategies, techniques and tactics used toincrease the amount of visitors to a website byobtaining a high-ranking placement in the searchresults page of a search engine (SERP)-- including Google, Bing, Yahoo and other search engines.Source |
  5. 5. by Naji El KotobRobots.txt
  6. 6. by Naji El KotobRobots.txt Robots.txt is the file that Search Enginesuse to see what they should index. This file and site maps help make yoursite easier to navigate by the bots andlet them know what is legal and what youwould rather not have the published intheir engines.
  7. 7. by Naji El KotobRobots.txt
  8. 8. by Naji El KotobRobots.txt SyntaxUser-agent: *Disallow:Sitemap:
  9. 9. by Naji El KotobRobots.txt Generator
  10. 10. by Naji El KotobInteractive Demo
  11. 11. by Naji El KotobDemo Design and Create a Dynamic RobotsSource | a Dynamic Robots.txt file to an ASP.NET MVC siteRobots.txt is required to allow search engines to properly index yoursite, and more importantly not index it.If you have a public-facing staging or preliminary site that you don’twant to show up in Google results, you need to make sure that itreturns the correct robots.txt with theDisallow: /line to prevent indexing. However, manually adding robots.txt filesto staging and production environments as a manual process can beimproved with the process below – the same code can serve up alocked down robots.txt in staging or internal URLs, and allowindexing in production.
  12. 12. by Naji El KotobDemo (contd) You’ll also need to make sure thatrunAllManagedModulesForAllRequests istrue in web.config as normally text filesbypass the ASP.NET pipeline:<system.webServer><modules runAllManagedModulesForAllRequests="true"></modules>...</system.webServer>
  13. 13. by Naji El KotobDemo (contd)routes.MapRoute("Robots.txt","robots.txt",new{controller = "Robots",action = "RobotsText"});
  14. 14. by Naji El KotobDemo (contd)The create a new controller called “RobotsController” with a single action “RobotsText”. All requests to /robots.txt will gohere:public class RobotsController : Controller{public FileContentResult RobotsText(){var contentBuilder = new StringBuilder();contentBuilder.AppendLine("User-agent: *");// change this to however you want to detect a production URLvar isProductionUrl = Request.Url != null &&!Request.Url.ToString().ToLowerInvariant().Contains("elasticbeanstalk");if (isProductionUrl){contentBuilder.AppendLine("Disallow: /elmah.axd");contentBuilder.AppendLine("Disallow: /admin");contentBuilder.AppendLine("Disallow: /Admin");contentBuilder.AppendLine("Sitemap:");}else{contentBuilder.AppendLine("Disallow: /");}return File(Encoding.UTF8.GetBytes(contentBuilder.ToString()), "text/plain");}}
  15. 15. by Naji El KotobSitemap
  16. 16. by Naji El KotobSitemap Sitemap (XML) is a list of pages on your Website.It is easiest way to give Google, and other searchengines, information about your site and mayspeed up Google’s crawlers finding you. There are many advantages of submitting aSitemap to Google, especially if your site is newand doesn’t have many backlinks.Source |
  17. 17. by Naji El KotobSitemap Format<?xml version="1.0" encoding="UTF-8"?><urlset xmlns=""><url><loc></loc><lastmod>2005-01-01</lastmod><changefreq>monthly</changefreq><priority>0.8</priority></url></urlset>Source |
  18. 18. by Naji El KotobSitemap Generators There are hundreds of online tools thatcan be used to create an XML sitemapthat can be submitted to Google, Bing,Yahoo and other◦ E.g. And more…
  19. 19. by Naji El KotobReferences
  20. 20. by Naji El KotobQnA?
  21. 21. by Naji El KotobThank You  Please send your feedback andsuggestions to:◦ naji [@] Join us