a developers guide to seo

7
Professional Search Engine Optimization with ASP.NET A Developers Guide to SEO Cristian Darie Jaimie Sirovich BICINTI Wiley Publishing, Inc.

Upload: others

Post on 24-May-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Developers Guide to SEO

Professional

Search Engine Optimization with ASP.NET A Developers Guide to SEO

Cristian Darie Jaimie Sirovich

B I C I N T I

Wiley Publishing, Inc.

Page 2: A Developers Guide to SEO

Contents

Acknowledgments vii Introduction xv

Chapter 1 : You: Programmer and Search Engine Marketer 1

Who Are You? 2 What Do You Need to Learn? 3

SEO and the Site Architecture 4 SEO Cannot Be an Afterthought 5 Communicating Architectural Decisions 5 Architectural Minutia Can Make or Break You 5

Preparing Your Playground 6 Installing Visual Web Developer 2005 Express Edition 6 Installing SQL Server 2005 Express Edition 7 Installing SQL Server Management Studio Express 8 Installing IIS 8 Creating the seoasp Web Site 10 Creating the seoasp Web Application 12 Creating the seoasp SQL Server Database 15

Summary 19

Chapter 2 : A Primer in Basic SEO 2 1

Introduction to SEO 2 1 Link Equity 22 Google PageRank 23 A Word on Usability and Accessibility 24

Search Engine Ranking Factors 25 On-Page Factors 25 Visible On-Page Factors 26 Invisible On-Page Factors 28 Time-Based Factors 30 External Factors 31

Potential Search Engine Penalties 34 The Google "Sandbox Effect" 34 The Expired Domain Penalty 35 Duplicate Content Penalty 35 The Google Supplemental Index 35

Page 3: A Developers Guide to SEO

Contents

Resources and Tools 36 Web Analytics 36 Market Research 37 Researching Keywords 40 Browser Plugins 41 Community Forums 42 Search Engine Blogs and Resources 43

Summary 43

Chapter 3: Proyocative SE-Friendly URLs 45

Why Do URLs Matter? 46 Static URLs and Dynamic URLs 47

Static URLs 48 Dynamic URLs 48 URLs and Duplicate Content 49

URLs of the Real World 49 Example #1 : Dynamic URLs 49 Example #2: Numeric Rewritten URLs 51 Example #3: Keyword-Rich Rewritten URLs 51 Maintaining URL Consistency 52

Implementing URL Rewriting 53 URL Rewriting with IIS and ISAPI Rewrite 55

Introducing Regulär Expressions 64 Rewriting Numeric URLs with Two Parameters 69 Rewriting Keyword-Rich URLs 72

URL Rewriting with ASP.NET and UrlRewriter.NET 75 Configuring IIS to Pass All Requests to ASPNET 75 Using UrlRewriter.NET 76

Creating Your Own Rewriting Code 82 Technical Considerations 83

Handling Postbacks Correctly 84 Absolute Paths and - / 86

Rewriting ID-Free URLs 87 .NET Regulär Expressions 87 Rewriting ID-Free URLs Using Generic Handlers 90 Rewriting ID-Free URLs Using HTTP Modules 94

Rewriting Images and Streaming Media 96 Building a Link Factory 98 Problems Rewriting Doesn't Solve 104

A Last Word of Caution 105 Summary 105

x

Page 4: A Developers Guide to SEO

Contents

Chapter 4: Content Relocation and HTTP Status Codes 1QZ

The HTTP Status Codes 108 Redirection Using 3 0 1 and 302 109

301 111 302 112

Removing Deleted Pages Using 404 112 Avoiding Indexing Error Pages Using 500 114 Building Custom Error Pages 114 Redirecting with ASP.NET and IIS 123

URL Correction 124 Dealing with Multiple Domain Names Properly 130 Using Redirects to Change Domain Names 130 URL Canonicalization: www.example.com vs. example.com 131 URL Canonicalization: /Default.aspx vs. / 132

Other Types of Redirects 132 Summary 132

Chapter 5: Duplicate Content 1 3 3

Causes and Effects of Duplicate Content 134 Duplicate Content as a Result of Site Architecture 134 Duplicate Content as a Result of Content Theft 135

Excluding Duplicate Content 135 Using the Robots Meta Tag 136 robots.txt Pattern Exclusion 137

Solutions for Commonly Duplicated Pages 142 Print-Friendly Pages 143 Navigation Links and Breadcrumb Navigation 143 Similar Pages 145 Pages with Duplicate Meta Tag or Title Values 146 URL Canonicalization 146 URL-Based Session IDs 146 Other Navigational Link Parameters 148 Affiliate Pages 148

Summary 154

Chapter 6: SE-Friendly HTML and JavaScript 155.

Overall Architecture 156 Search Engine-Friendly JavaScript 156

JavaScript Links 157 DHTML Menüs 157

XI

Page 5: A Developers Guide to SEO

Contents

Popup Windows DHTML Popup Windows Crawlable Images and Graphical Text

Search Engine-Friendly HTML HTML Structural Elements Copy Prominence and Tables Frames Using Forms

Using a Custom Markup Language to Generate SE-Friendly HTML Flash and AJAX

The Blended Approach Summary

Chapter 7: Web Feeds and Social Bookmarking

Web Feeds RSS and Atom

Creating RSS Feeds Syndicating RSS Feeds Other Sources of Syndicated Content Social Bookmarking Summary

Chapter 8: Black Hat SEO

What's with All the Hats? Bending the Rules Technical Analysis of Black-Hat Techniques

Attack Avoidance Insertion Attacks HTML Insertion Attacks Avoiding Comment Attacks Using Nofollow Sanitizing User Input Requesting Human Input 301 Redirect Attacks Content Theft On Buying Links Digital Point Co-op, Link Vault

Summary

ChaDter 9: Sitemaps

157 164 164 1 7 1 171 172 175 176 176 1 8 1 181 182

1 8 3

183 184 186 1 9 1 194 194 210

2 1 1

212 213 214 215 215 216 220 225 230 237 239 240 240 2 4 1

2 4 3

Traditional Sitemaps 243

xii

Page 6: A Developers Guide to SEO

Contents

Search Engine Sitemaps 244 Using Google Sitemaps 245 Using Yahoo! Sitemaps 247

Informing Google about Updates 247 The Sitemaps.org Standard Protocol 248 Generating Sitemaps Programmatically 249 Summary 255

Chapter 10: Link Bait 2 5 1

Hooking Links 258 Informational Hooks 258 News Story Hooks 258 Humor/Fun Hooks 258 Evil Hooks 259

Traditional Examples of Link Bait 259 Interactive Link Bait: Put on Your Programming Hardhat! 259 Case Study: Fortune Cookies 260 Summary 264

Chapter 1 1 : Cloaking, Geo-Targetingf and IP Delivery 2ß5_

About Cloaking, Geo-Targeting, and IP Delivery 265 More on Geo-Targeting 266 A Few Words on JavaScript Redirect Cloaking 267 The Ethical Debate on Cloaking 267 Cloaking Dangers 268 Using the Meta Noarchive Tag 268

Implementing Cloaking 269 Cloaking Case Studies 290

Rendering Images as Text 290 Redirecting Excluded Content 291 Feeding Subscription-Based Content Only to Spiders 291

Implementing Geo-Targeting 291 Summary 298

Chapter 12: Foreign Language SEO 299_

Foreign Language Optimization Tips 299 Indicating Language and Region 300 Server Location and Domain Name 300 Include the Address of the Foreign Location if Possible 301 Dealing with Accented Letters (Diacritics) 301

XIII

Page 7: A Developers Guide to SEO

Contents

Foreign Language Spamming 305 Summary 306

Chapter 13: Coping with Technical Issues 307

Unreliable Web Hosting or DNS 307 Changing Hosting Providers 308 Cross-Linking 309 SEO-Aware Split Testing 310 Detecting Broken Links 312 Summary 318

Chapter 14: Case Study: Building an E-Commerce Store 319

Establishing the Requirements 319 Implementing the Product Cataiog 320 Summary 350

Chapter 15: Site Clinic: So You Have a Web Site? 3 5 1

1 . Creating Sitemaps 352 2. Creating News Feeds 352 3. Fixing Duplication in Titles and Meta Tags 352 4. Getting Listed in Reputable Directories 352 5. Soliciting and Exchanging Relevant Links 353 6. Buying Links 353 7. Creating Link Bait 353 8. Adding Social Bookmarking Functionality 354 9. Starting a Blog and/or Forum 354 10. Dealing with a Pure Flash or AJAX Site 354 11. Preventing Black Hat Victimization 354 12. Examining Your URLs for Problems 355 13. Looking for Duplicate Content 355 14. Eliminating Session IDs 355 15. Tweaking On-Page Factors 355 Summary 356

Appendix A: Simple Regulär Expressions 357

Glossary 389

Index 399

xiv