SlideShare a Scribd company logo
Robots and Sitemap
By Naji El Kotob.
Information Technology Consultant
_______________________________
naji [@] DotNETHeroes.com
Review 1.0.1 - 13
.
Business Intelligence Group BIG SARL
by Naji El Kotob
Outlines
 SEO
 Robots.txt
 Sitemap.xml
 Q&A
by Naji El Kotob
SEO
by Naji El Kotob
What is SEO
 SEO is short for search engine optimization or
search engine optimizer.
 Search engine optimization is a methodology of
strategies, techniques and tactics used to
increase the amount of visitors to a website by
obtaining a high-ranking placement in the search
results page of a search engine (SERP)
-- including Google, Bing, Yahoo and other search engines.
Source | http://www.webopedia.com/TERM/S/SEO.html
by Naji El Kotob
Robots.txt
by Naji El Kotob
Robots.txt
 Robots.txt is the file that Search Engines
use to see what they should index.
 This file and site maps help make your
site easier to navigate by the bots and
let them know what is legal and what you
would rather not have the published in
their engines.
by Naji El Kotob
Robots.txt
by Naji El Kotob
Robots.txt Syntax
User-agent: *
Disallow:
Sitemap: http://dotnetheroes.com/sitemap.xml
by Naji El Kotob
Robots.txt Generator
http://tools.seobook.com/robo
ts-txt/generator/
by Naji El Kotob
Interactive Demo
by Naji El Kotob
Demo
 Design and Create a Dynamic Robots
Source | http://www.edandersen.com/2013/02/17/adding-a-dynamic-robots-txt-file-to-an-asp-net-mvc-site/
Adding a Dynamic Robots.txt file to an ASP.NET MVC site
Robots.txt is required to allow search engines to properly index your
site, and more importantly not index it.
If you have a public-facing staging or preliminary site that you don’t
want to show up in Google results, you need to make sure that it
returns the correct robots.txt with the
Disallow: /
line to prevent indexing. However, manually adding robots.txt files
to staging and production environments as a manual process can be
improved with the process below – the same code can serve up a
locked down robots.txt in staging or internal URLs, and allow
indexing in production.
by Naji El Kotob
Demo (cont'd)
 You’ll also need to make sure that
runAllManagedModulesForAllRequests is
true in web.config as normally text files
bypass the ASP.NET pipeline:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
</modules>
...
</system.webServer>
by Naji El Kotob
Demo (cont'd)
routes.MapRoute(
"Robots.txt",
"robots.txt",
new
{
controller = "Robots",
action = "RobotsText"
}
);
by Naji El Kotob
Demo (cont'd)
The create a new controller called “RobotsController” with a single action “RobotsText”. All requests to /robots.txt will go
here:
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 URL
var 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: http://www.mysite.com/sitemap.xml");
}
else
{
contentBuilder.AppendLine("Disallow: /");
}
return File(Encoding.UTF8.GetBytes(contentBuilder.ToString()), "text/plain");
}
}
by Naji El Kotob
Sitemap
by Naji El Kotob
Sitemap
 Sitemap (XML) is a list of pages on your Website.
It is easiest way to give Google, and other search
engines, information about your site and may
speed up Google’s crawlers finding you.
 There are many advantages of submitting a
Sitemap to Google, especially if your site is new
and doesn’t have many backlinks.
Source | http://diywebjem.com/webdefinitions.html
by Naji El Kotob
Sitemap Format
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.example.com/</loc>
<lastmod>2005-01-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Source | http://www.sitemaps.org/protocol.html
by Naji El Kotob
Sitemap Generators
 There are hundreds of online tools that
can be used to create an XML sitemap
that can be submitted to Google, Bing,
Yahoo and other
◦ E.g.
 http://www.xml-sitemaps.com/
 http://www.sitemapdoc.com/
 And more…
by Naji El Kotob
References
 http://geekswithblogs.net/jjulian/archive/2012/04/25/adding-robots.txt-
to-your-asp.net-mvc-3-applications.aspx
 http://tools.seobook.com/robots-txt/
 http://www.edandersen.com/2013/02/17/adding-a-dynamic-robots-txt-
file-to-an-asp-net-mvc-site/
by Naji El Kotob
QnA?
by Naji El Kotob
Thank You 
 Please send your feedback and
suggestions to:
◦ naji [@] DotNETHeroes.com
 Join us at
www.facebook.com/DotNETHeroes

More Related Content

PPTX
Canonical and robotos (2)
PPTX
Browsers_SameOriginPolicy_CORS_ContentSecurityPolicy
PDF
Javascript cross domain communication
PPTX
Web Security - Cookies, Domains and CORS
PDF
Cross site calls with javascript - the right way with CORS
PPTX
Misconfigured CORS, Why being secure isn't getting easier. AppSec USA 2016
PPT
Same origin policy
RTF
Site Mocikut
Canonical and robotos (2)
Browsers_SameOriginPolicy_CORS_ContentSecurityPolicy
Javascript cross domain communication
Web Security - Cookies, Domains and CORS
Cross site calls with javascript - the right way with CORS
Misconfigured CORS, Why being secure isn't getting easier. AppSec USA 2016
Same origin policy
Site Mocikut

What's hot (20)

PDF
CORS and (in)security
PPT
Breaking The Cross Domain Barrier
PDF
Server Logs: After Excel Fails
PPT
External Data Access with jQuery
PPTX
Difference between robots txt file, meta robots, X-robots tag
PPTX
Android Lab Test : Using the network with HTTP (english)
PPTX
Introduction to google hacking database
DOCX
Sec.1 กล ม 1 เร__องการสร_างแบบฟอร_มและการส_งค_าต_วแปร
PPTX
Php file upload, cookies & session
PPTX
Google Dorks
PDF
RESTAPI_SPHOSTED_APP
PDF
Restap ito uploadfilessharepoint
PDF
&lt;img src="../i/r_14.png" />
PDF
RicoAjaxEngine
PPTX
CS1520 Session 2 - Simple Router
PPT
Website Design, Development & Maintenance | Foundations | Week 01
KEY
Modernizr, Yepnope, and Polyfills
PDF
Google Hack
KEY
Chirp 2010: Too many secrets, but never enough: OAuth at Twitter
PDF
ASP.Net, move data to and from a SQL Server Database
CORS and (in)security
Breaking The Cross Domain Barrier
Server Logs: After Excel Fails
External Data Access with jQuery
Difference between robots txt file, meta robots, X-robots tag
Android Lab Test : Using the network with HTTP (english)
Introduction to google hacking database
Sec.1 กล ม 1 เร__องการสร_างแบบฟอร_มและการส_งค_าต_วแปร
Php file upload, cookies & session
Google Dorks
RESTAPI_SPHOSTED_APP
Restap ito uploadfilessharepoint
&lt;img src="../i/r_14.png" />
RicoAjaxEngine
CS1520 Session 2 - Simple Router
Website Design, Development & Maintenance | Foundations | Week 01
Modernizr, Yepnope, and Polyfills
Google Hack
Chirp 2010: Too many secrets, but never enough: OAuth at Twitter
ASP.Net, move data to and from a SQL Server Database
Ad

Viewers also liked (20)

PPTX
Tutorial on how to use Mailertite (Part1)- How to Setup Mailerlite and Make ...
PPT
2310 b 05
PPTX
Mailerlite. Удобный email-маркетинг
PPTX
Site map
PPTX
MailerLite Tutorial
PDF
Grudinkina EmailConf 2016
PPTX
Generic Repository Pattern with ASP.NET MVC and EF
PDF
The world of enterprise solution development with asp.net and C#
PDF
Elizabeth verar how to use mailerlite as email marketing tool
PPSX
ASP.NET Web form
PPT
Intro To Asp Net And Web Forms
PPTX
Web forms in ASP.net
PPTX
Jsp (java server page)
PPTX
Clipping in Computer Graphics
PPT
Lecture 2d point,curve,text,line clipping
PPSX
Java server pages
PPTX
Sitemap Templates by Creately
PPTX
Introduction to asp.net
PPT
Clipping
Tutorial on how to use Mailertite (Part1)- How to Setup Mailerlite and Make ...
2310 b 05
Mailerlite. Удобный email-маркетинг
Site map
MailerLite Tutorial
Grudinkina EmailConf 2016
Generic Repository Pattern with ASP.NET MVC and EF
The world of enterprise solution development with asp.net and C#
Elizabeth verar how to use mailerlite as email marketing tool
ASP.NET Web form
Intro To Asp Net And Web Forms
Web forms in ASP.net
Jsp (java server page)
Clipping in Computer Graphics
Lecture 2d point,curve,text,line clipping
Java server pages
Sitemap Templates by Creately
Introduction to asp.net
Clipping
Ad

Similar to Robots and-sitemap - Version 1.0.1 (20)

PDF
Lesson 4.pdf
PDF
Technical SEO Audit – 15 Point Checklist
PDF
Best 20 SEO Techniques To Improve Website Visibility In SERP
PPTX
What is a Robot txt file?
DOCX
Online fast food django.docx
PDF
Search Engine Optimization ( Seo )
PPT
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
PPTX
Make xCommerce fit to you
PPT
White Hat Cloaking
PDF
Digital Marketing Classes in Pune- SIM
PDF
Digital Marketing Classes in Pune- SIM
PDF
Digital Marketing Classes in Pune- SIM
PDF
Digital Marketing Classes in Pune- SIM
PDF
Digital Marketing Classes in Pune- SIM
PDF
Search Engine Optimization
PDF
Search Engine Optimization
PDF
Search Engine Optimization (SEO)
PDF
Search Engine Optimization(seo)-school of Internet Marketing
PDF
Search Engine Optimization
PDF
search engine optimization
Lesson 4.pdf
Technical SEO Audit – 15 Point Checklist
Best 20 SEO Techniques To Improve Website Visibility In SERP
What is a Robot txt file?
Online fast food django.docx
Search Engine Optimization ( Seo )
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
Make xCommerce fit to you
White Hat Cloaking
Digital Marketing Classes in Pune- SIM
Digital Marketing Classes in Pune- SIM
Digital Marketing Classes in Pune- SIM
Digital Marketing Classes in Pune- SIM
Digital Marketing Classes in Pune- SIM
Search Engine Optimization
Search Engine Optimization
Search Engine Optimization (SEO)
Search Engine Optimization(seo)-school of Internet Marketing
Search Engine Optimization
search engine optimization

More from Naji El Kotob (9)

PDF
SSRS Report with Parameters and Data Filtration
PDF
Odoo - Educational Account for Students and Teachers Ver. 2.0
PDF
Google search - Tips and Tricks
PDF
Microsoft SQL Server - Files and Filegroups
PDF
tempdb and Performance Keys
PDF
Microsoft SQL Server 2012 Components and Tools (Quick Overview) - Rev 1.3
PDF
T-SQL Data Types (Quick Overview)
PPTX
Practical MS SQL Introduction
PPTX
MVC and Razor - Doc. v1.2
SSRS Report with Parameters and Data Filtration
Odoo - Educational Account for Students and Teachers Ver. 2.0
Google search - Tips and Tricks
Microsoft SQL Server - Files and Filegroups
tempdb and Performance Keys
Microsoft SQL Server 2012 Components and Tools (Quick Overview) - Rev 1.3
T-SQL Data Types (Quick Overview)
Practical MS SQL Introduction
MVC and Razor - Doc. v1.2

Recently uploaded (20)

PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Pre independence Education in Inndia.pdf
PPTX
Cell Types and Its function , kingdom of life
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Cell Structure & Organelles in detailed.
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
master seminar digital applications in india
PDF
Complications of Minimal Access Surgery at WLH
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Classroom Observation Tools for Teachers
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Sports Quiz easy sports quiz sports quiz
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Supply Chain Operations Speaking Notes -ICLT Program
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
VCE English Exam - Section C Student Revision Booklet
Pre independence Education in Inndia.pdf
Cell Types and Its function , kingdom of life
Final Presentation General Medicine 03-08-2024.pptx
Cell Structure & Organelles in detailed.
2.FourierTransform-ShortQuestionswithAnswers.pdf
TR - Agricultural Crops Production NC III.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
master seminar digital applications in india
Complications of Minimal Access Surgery at WLH
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Classroom Observation Tools for Teachers
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Sports Quiz easy sports quiz sports quiz
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape

Robots and-sitemap - Version 1.0.1

  • 1. Robots and Sitemap By Naji El Kotob. Information Technology Consultant _______________________________ naji [@] DotNETHeroes.com Review 1.0.1 - 13 . Business Intelligence Group BIG SARL
  • 2. by Naji El Kotob Outlines  SEO  Robots.txt  Sitemap.xml  Q&A
  • 3. by Naji El Kotob SEO
  • 4. by Naji El Kotob What is SEO  SEO is short for search engine optimization or search engine optimizer.  Search engine optimization is a methodology of strategies, techniques and tactics used to increase the amount of visitors to a website by obtaining a high-ranking placement in the search results page of a search engine (SERP) -- including Google, Bing, Yahoo and other search engines. Source | http://www.webopedia.com/TERM/S/SEO.html
  • 5. by Naji El Kotob Robots.txt
  • 6. by Naji El Kotob Robots.txt  Robots.txt is the file that Search Engines use to see what they should index.  This file and site maps help make your site easier to navigate by the bots and let them know what is legal and what you would rather not have the published in their engines.
  • 7. by Naji El Kotob Robots.txt
  • 8. by Naji El Kotob Robots.txt Syntax User-agent: * Disallow: Sitemap: http://dotnetheroes.com/sitemap.xml
  • 9. by Naji El Kotob Robots.txt Generator http://tools.seobook.com/robo ts-txt/generator/
  • 10. by Naji El Kotob Interactive Demo
  • 11. by Naji El Kotob Demo  Design and Create a Dynamic Robots Source | http://www.edandersen.com/2013/02/17/adding-a-dynamic-robots-txt-file-to-an-asp-net-mvc-site/ Adding a Dynamic Robots.txt file to an ASP.NET MVC site Robots.txt is required to allow search engines to properly index your site, and more importantly not index it. If you have a public-facing staging or preliminary site that you don’t want to show up in Google results, you need to make sure that it returns the correct robots.txt with the Disallow: / line to prevent indexing. However, manually adding robots.txt files to staging and production environments as a manual process can be improved with the process below – the same code can serve up a locked down robots.txt in staging or internal URLs, and allow indexing in production.
  • 12. by Naji El Kotob Demo (cont'd)  You’ll also need to make sure that runAllManagedModulesForAllRequests is true in web.config as normally text files bypass the ASP.NET pipeline: <system.webServer> <modules runAllManagedModulesForAllRequests="true"> </modules> ... </system.webServer>
  • 13. by Naji El Kotob Demo (cont'd) routes.MapRoute( "Robots.txt", "robots.txt", new { controller = "Robots", action = "RobotsText" } );
  • 14. by Naji El Kotob Demo (cont'd) The create a new controller called “RobotsController” with a single action “RobotsText”. All requests to /robots.txt will go here: 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 URL var 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: http://www.mysite.com/sitemap.xml"); } else { contentBuilder.AppendLine("Disallow: /"); } return File(Encoding.UTF8.GetBytes(contentBuilder.ToString()), "text/plain"); } }
  • 15. by Naji El Kotob Sitemap
  • 16. by Naji El Kotob Sitemap  Sitemap (XML) is a list of pages on your Website. It is easiest way to give Google, and other search engines, information about your site and may speed up Google’s crawlers finding you.  There are many advantages of submitting a Sitemap to Google, especially if your site is new and doesn’t have many backlinks. Source | http://diywebjem.com/webdefinitions.html
  • 17. by Naji El Kotob Sitemap Format <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://www.example.com/</loc> <lastmod>2005-01-01</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> </url> </urlset> Source | http://www.sitemaps.org/protocol.html
  • 18. by Naji El Kotob Sitemap Generators  There are hundreds of online tools that can be used to create an XML sitemap that can be submitted to Google, Bing, Yahoo and other ◦ E.g.  http://www.xml-sitemaps.com/  http://www.sitemapdoc.com/  And more…
  • 19. by Naji El Kotob References  http://geekswithblogs.net/jjulian/archive/2012/04/25/adding-robots.txt- to-your-asp.net-mvc-3-applications.aspx  http://tools.seobook.com/robots-txt/  http://www.edandersen.com/2013/02/17/adding-a-dynamic-robots-txt- file-to-an-asp-net-mvc-site/
  • 20. by Naji El Kotob QnA?
  • 21. by Naji El Kotob Thank You   Please send your feedback and suggestions to: ◦ naji [@] DotNETHeroes.com  Join us at www.facebook.com/DotNETHeroes