SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

External Data Access with jQuery
External Data Access with jQueryExternal Data Access with jQuery
External Data Access with jQuery
Doncho Minkov
 
Sec.1 กล ม 1 เร__องการสร_างแบบฟอร_มและการส_งค_าต_วแปร
Sec.1 กล  ม 1 เร__องการสร_างแบบฟอร_มและการส_งค_าต_วแปรSec.1 กล  ม 1 เร__องการสร_างแบบฟอร_มและการส_งค_าต_วแปร
Sec.1 กล ม 1 เร__องการสร_างแบบฟอร_มและการส_งค_าต_วแปร
Bongza Naruk
 
Php file upload, cookies & session
Php file upload, cookies & sessionPhp file upload, cookies & session
Php file upload, cookies & session
Jamshid Hashimi
 
Google Dorks
Google DorksGoogle Dorks
Google Dorks
Andrea D'Ubaldo
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
tutorialsruby
 

Was ist angesagt? (20)

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

Andere mochten auch

Mailerlite. Удобный email-маркетинг
Mailerlite. Удобный email-маркетингMailerlite. Удобный email-маркетинг
Mailerlite. Удобный email-маркетинг
Mailer
 
Grudinkina EmailConf 2016
Grudinkina EmailConf 2016Grudinkina EmailConf 2016
Grudinkina EmailConf 2016
Mailer
 
Lecture 2d point,curve,text,line clipping
Lecture   2d point,curve,text,line clippingLecture   2d point,curve,text,line clipping
Lecture 2d point,curve,text,line clipping
avelraj
 

Andere mochten auch (20)

Tutorial on how to use Mailertite (Part1)- How to Setup Mailerlite and Make ...
Tutorial on how to use Mailertite (Part1)- How to Setup  Mailerlite and Make ...Tutorial on how to use Mailertite (Part1)- How to Setup  Mailerlite and Make ...
Tutorial on how to use Mailertite (Part1)- How to Setup Mailerlite and Make ...
 
2310 b 05
2310 b 052310 b 05
2310 b 05
 
Mailerlite. Удобный email-маркетинг
Mailerlite. Удобный email-маркетингMailerlite. Удобный email-маркетинг
Mailerlite. Удобный email-маркетинг
 
Site map
Site mapSite map
Site map
 
MailerLite Tutorial
MailerLite TutorialMailerLite Tutorial
MailerLite Tutorial
 
A View about ASP .NET and their objectives
A View about ASP .NET and their objectivesA View about ASP .NET and their objectives
A View about ASP .NET and their objectives
 
Grudinkina EmailConf 2016
Grudinkina EmailConf 2016Grudinkina EmailConf 2016
Grudinkina EmailConf 2016
 
Generic Repository Pattern with ASP.NET MVC and EF
Generic Repository Pattern with ASP.NET MVC and EFGeneric Repository Pattern with ASP.NET MVC and EF
Generic Repository Pattern with ASP.NET MVC and EF
 
The world of enterprise solution development with asp.net and C#
The world of enterprise solution development with asp.net and C#The world of enterprise solution development with asp.net and C#
The world of enterprise solution development with asp.net and C#
 
Elizabeth verar how to use mailerlite as email marketing tool
Elizabeth verar how to use mailerlite as email marketing toolElizabeth verar how to use mailerlite as email marketing tool
Elizabeth verar how to use mailerlite as email marketing tool
 
ASP.NET Web form
ASP.NET Web formASP.NET Web form
ASP.NET Web form
 
Intro To Asp Net And Web Forms
Intro To Asp Net And Web FormsIntro To Asp Net And Web Forms
Intro To Asp Net And Web Forms
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
Jsp (java server page)
Jsp (java server page)Jsp (java server page)
Jsp (java server page)
 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer Graphics
 
Lecture 2d point,curve,text,line clipping
Lecture   2d point,curve,text,line clippingLecture   2d point,curve,text,line clipping
Lecture 2d point,curve,text,line clipping
 
Java server pages
Java server pagesJava server pages
Java server pages
 
Sitemap Templates by Creately
Sitemap Templates by CreatelySitemap Templates by Creately
Sitemap Templates by Creately
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
Clipping
ClippingClipping
Clipping
 

Ähnlich wie Robots and-sitemap - Version 1.0.1

Search Engine Optimization ( Seo )
Search Engine Optimization ( Seo )Search Engine Optimization ( Seo )
Search Engine Optimization ( Seo )
Heather Dionne
 

Ähnlich wie Robots and-sitemap - Version 1.0.1 (20)

Lesson 4.pdf
Lesson 4.pdfLesson 4.pdf
Lesson 4.pdf
 
Technical SEO Audit – 15 Point Checklist
Technical SEO Audit – 15 Point ChecklistTechnical SEO Audit – 15 Point Checklist
Technical SEO Audit – 15 Point Checklist
 
What is a Robot txt file?
What is a Robot txt file?What is a Robot txt file?
What is a Robot txt file?
 
Online fast food django.docx
Online fast food django.docxOnline fast food django.docx
Online fast food django.docx
 
Search Engine Optimization ( Seo )
Search Engine Optimization ( Seo )Search Engine Optimization ( Seo )
Search Engine Optimization ( Seo )
 
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
Monorail presentation at WebDevelopersCommunity, Feb 1, 2009
 
Make xCommerce fit to you
Make xCommerce fit to youMake xCommerce fit to you
Make xCommerce fit to you
 
White Hat Cloaking
White Hat CloakingWhite Hat Cloaking
White Hat Cloaking
 
Digital Marketing Classes in Pune- SIM
Digital Marketing Classes in Pune- SIMDigital Marketing Classes in Pune- SIM
Digital Marketing Classes in Pune- SIM
 
Digital Marketing Classes in Pune- SIM
Digital Marketing Classes in Pune- SIMDigital Marketing Classes in Pune- SIM
Digital Marketing Classes in Pune- SIM
 
Digital Marketing Classes in Pune- SIM
Digital Marketing Classes in Pune- SIMDigital Marketing Classes in Pune- SIM
Digital Marketing Classes in Pune- SIM
 
Digital Marketing Classes in Pune- SIM
Digital Marketing Classes in Pune- SIMDigital Marketing Classes in Pune- SIM
Digital Marketing Classes in Pune- SIM
 
Digital Marketing Classes in Pune- SIM
Digital Marketing Classes in Pune- SIMDigital Marketing Classes in Pune- SIM
Digital Marketing Classes in Pune- SIM
 
Search Engine Optimization
Search Engine OptimizationSearch Engine Optimization
Search Engine Optimization
 
Search Engine Optimization(SEO)- School Of Internet Marketing
Search Engine Optimization(SEO)- School Of Internet MarketingSearch Engine Optimization(SEO)- School Of Internet Marketing
Search Engine Optimization(SEO)- School Of Internet Marketing
 
Search Engine Optimization(SEO)
Search Engine Optimization(SEO)Search Engine Optimization(SEO)
Search Engine Optimization(SEO)
 
Search Engine Optimization (SEO)
Search Engine Optimization (SEO)Search Engine Optimization (SEO)
Search Engine Optimization (SEO)
 
Search Engine Optimization
Search Engine OptimizationSearch Engine Optimization
Search Engine Optimization
 
Search Engine Optimization
Search Engine OptimizationSearch Engine Optimization
Search Engine Optimization
 
Search Engine Optimization (seo)- School Of Internet Marketing
Search Engine Optimization (seo)- School Of Internet MarketingSearch Engine Optimization (seo)- School Of Internet Marketing
Search Engine Optimization (seo)- School Of Internet Marketing
 

Mehr von Naji El Kotob (9)

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

Kürzlich hochgeladen

Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Kürzlich hochgeladen (20)

Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 

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