Professional Search Engine Optimization with PHP: A Developer's Guide to SEO

Book description

Maybe you're a great programmer or IT professional, but marketing isn't your thing. Or perhaps you're a tech-savvy search engine marketer who wants a peek under the hood of a search engine optimized web site. Search engine marketing is a field where technology and marketing are both critical and interdependent, because small changes in the implementation of a web site can make you or break you in search engine rankings. Furthermore, the fusion of technology and marketing know-how can create web site features that attract more visitors.

The mission of this book is to help web developers create web sites that rank well with the major search engines, and to teach search engine marketers how to use technology to their advantage. We assert that neither marketing nor IT can exist in a vacuum, and it is essential that they not see themselves as opposing forces in an organization. They must work together. This book aims to educate both sides in that regard.

Table of contents

  1. Copyright
  2. About the Authors
  3. Credits
  4. Acknowledgments
  5. Introduction
    1. Who Should Read This Book
    2. What Will You Learn from this Book?
    3. Contacting the Authors
    4. Conventions
    5. Source Code
    6. Errata
    7. p2p.wrox.com
  6. 1. You: Programmer and Search Engine Marketer
    1. 1.1. Who Are You?
    2. 1.2. What Do You Need to Learn?
      1. 1.2.1. SEO and the Site Architecture
      2. 1.2.2. SEO Cannot Be an Afterthought
      3. 1.2.3. Communicating Architectural Decisions
      4. 1.2.4. Architect ural Minutiae Can Make or Break You
    3. 1.3. Preparing Your Playground
      1. 1.3.1. Installing XAMPP
      2. 1.3.2. Preparing the Working Folder
      3. 1.3.3. Preparing the Database
    4. 1.4. Summary
  7. 2. A Primer in Basic SEO
    1. 2.1. Introduction to SEO
      1. 2.1.1. Link Equity
      2. 2.1.2. Google PageRank
      3. 2.1.3. A Word on Usability and Accessibility
    2. 2.2. Search Engine Ranking Factors
      1. 2.2.1. On-Page Factors
      2. 2.2.2. Visible On-Page Factors
        1. 2.2.2.1. Page Title
        2. 2.2.2.2. Page Headings
        3. 2.2.2.3. Page Copy
        4. 2.2.2.4. Outbound Links
        5. 2.2.2.5. Keywords in Page URL and Domain Name
        6. 2.2.2.6. Internal Link Structure and Anchors
        7. 2.2.2.7. Overall Site Topicality
        8. 2.2.2.8. Invisible On-Page Factors
        9. 2.2.2.9. Meta Description
        10. 2.2.2.10. Meta Keywords
        11. 2.2.2.11. Alt and Title Attributes
        12. 2.2.2.12. Page Structure Considerations
      3. 2.2.3. Time-Based Factors
        1. 2.2.3.1. Site and Page Age
        2. 2.2.3.2. Link Age
        3. 2.2.3.3. Domain Registration Length
      4. 2.2.4. External Factors
        1. 2.2.4.1. Quantity of Inbound Links
        2. 2.2.4.2. Quality of Inbound Links
        3. 2.2.4.3. Relevance of Inbound Links
        4. 2.2.4.4. Link Churn
        5. 2.2.4.5. Link Acquisition Rate
        6. 2.2.4.6. Link Anchor Text and Surrounding Copy
        7. 2.2.4.7. Reciprocal Links
        8. 2.2.4.8. Number of Links on a Page
        9. 2.2.4.9. Semantic Relationship among Links on a Page
        10. 2.2.4.10. IP Addresses of Cross-Linked Sites
        11. 2.2.4.11. TLD of Domain Name for a Link
        12. 2.2.4.12. Link Location
        13. 2.2.4.13. Web Standards Compliance
        14. 2.2.4.14. Detrimental "Red-Flag" Factors
    3. 2.3. Potential Search Engine Penalties
      1. 2.3.1. The Google "Sandbox Effect"
      2. 2.3.2. The Expired Domain Penalty
      3. 2.3.3. Duplicate Content Penalty
      4. 2.3.4. The Google Supplemental Index
    4. 2.4. Resources and Tools
      1. 2.4.1. Web Analytics
        1. 2.4.1.1. Google Analytics
        2. 2.4.1.2. Other Web Analytics Tools
      2. 2.4.2. Market Research
        1. 2.4.2.1. Yahoo! Site Explorer
        2. 2.4.2.2. Google Trends
        3. 2.4.2.3. Alexa Rankings
      3. 2.4.3. Researching Keywords
      4. 2.4.4. Browser Plugins
      5. 2.4.5. Community Forums
      6. 2.4.6. Search Engine Blogs and Resources
    5. 2.5. Summary
  8. 3. Provocative SE-Friendly URLs
    1. 3.1. Why Do URLs Matter?
    2. 3.2. Static URLs and Dynamic URLs
      1. 3.2.1. Static URLs
      2. 3.2.2. Dynamic URLs
      3. 3.2.3. URLs and CTR
      4. 3.2.4. URLs and Duplicate Content
    3. 3.3. URLs of the Real World
      1. 3.3.1. Example #1: Dynamic URLs
      2. 3.3.2. Example #2: Numeric Rewritten URLs
      3. 3.3.3. Example #3: Keyword-Rich Rewritten URLs
      4. 3.3.4. Maintaining URL Consistency
    4. 3.4. URL Rewriting
      1. 3.4.1. Installing mod_rewrite
      2. 3.4.2. Testing mod_rewrite
      3. 3.4.3. Introducing Regular Expressions
      4. 3.4.4. URL Rewriting and PHP
      5. 3.4.5. Rewriting Numeric URLs with Two Parameters
      6. 3.4.6. Rewriting Keyword-Rich URLs
      7. 3.4.7. Building a Link Factory
      8. 3.4.8. Pagination and URL Rewriting
      9. 3.4.9. Rewriting Images and Streaming Media
    5. 3.5. Problems Rewriting Doesn't Solve
    6. 3.6. A Last Word of Caution
    7. 3.7. Summary
  9. 4. Content Relocation and HTTP Status Codes
    1. 4.1. HTTP Status Codes
    2. 4.2. Redirection Using 301 and 302
      1. 4.2.1. 301
      2. 4.2.2. 302
    3. 4.3. Removing Deleted Pages Using 404
    4. 4.4. Avoiding Indexing Error Pages Using 500
    5. 4.5. Redirecting with PHP and mod_rewrite
      1. 4.5.1. Using Redirects to Change File Names
      2. 4.5.2. URL Correction
      3. 4.5.3. Dealing with Multiple Domain Names Properly
      4. 4.5.4. Using Redirects to Change Domain Names
      5. 4.5.5. URL Canonicalization: www.example.com versus example.com
      6. 4.5.6. URL Canonicalization: /index.php versus /
    6. 4.6. Other Types of Redirects
    7. 4.7. Summary
  10. 5. Duplicate Content
    1. 5.1. Causes and Effects of Duplicate Content
      1. 5.1.1. Duplicate Content as a Result of Site Architecture
      2. 5.1.2. Duplicate Content as a Result of Content Theft
    2. 5.2. Excluding Duplicate Content
      1. 5.2.1. Using the Robots Meta Tag
      2. 5.2.2. robots.txt Pattern Exclusion
        1. 5.2.2.1. More robots.txt Examples
        2. 5.2.2.2. robots.txt Tips
        3. 5.2.2.3. Generating robots.txt On-the-Fly
        4. 5.2.2.4. Handling robots.txt Limitations
    3. 5.3. Solutions for Commonly Duplicated Pages
      1. 5.3.1. Print-Friendly Pages
      2. 5.3.2. Navigation Links and Breadcrumb Navigation
        1. 5.3.2.1. Using One Primary Category and robots.txt or Meta-Exclusion
        2. 5.3.2.2. Changing Up the Content on the Various Permutations
        3. 5.3.2.3. Some Thoughts
      3. 5.3.3. Similar Pages
      4. 5.3.4. Pages with Duplicate Meta Tag or Title Values
      5. 5.3.5. URL Canonicalization
      6. 5.3.6. URL-Based Session IDs
      7. 5.3.7. Other Navigational Link Parameters
      8. 5.3.8. Affiliate Pages
        1. 5.3.8.1. Using Referrers and Cookies instead of Query String Parameters
        2. 5.3.8.2. Using Excluded Affiliate URLs
      9. 5.3.9. Redirecting Parameterized Affiliate URLs
        1. 5.3.9.1. Example #1
        2. 5.3.9.2. Example #2
    4. 5.4. Summary
  11. 6. SE-Friendly HTML and JavaScript
    1. 6.1. Overall Architecture
    2. 6.2. Search Engine-Friendly JavaScript
      1. 6.2.1. JavaScript Links
      2. 6.2.2. DHTML Menus
      3. 6.2.3. Popup Windows
        1. 6.2.3.1. Implementing Popup Navigation
      4. 6.2.4. DHTML Popup Windows
      5. 6.2.5. Crawlable Images and Graphical Text
        1. 6.2.5.1. The "sIFR" Replacement Method
        2. 6.2.5.2. Stewart Rosenberger's Text Replacement Method
    3. 6.3. Search Engine-Friendly HTML
      1. 6.3.1. HTML Structural Elements
      2. 6.3.2. Copy Prominence and Tables
      3. 6.3.3. The Table Trick Explained
      4. 6.3.4. Frames
      5. 6.3.5. Using Forms
    4. 6.4. Using a Custom Markup Language to Generate SE-Friendly HTML
    5. 6.5. Flash and AJAX
      1. 6.5.1. The Blended Approach
    6. 6.6. Summary
  12. 7. Web Feeds and Social Bookmarking
    1. 7.1. Web Feeds
      1. 7.1.1. RSS and Atom
    2. 7.2. Creating RSS Feeds
    3. 7.3. Syndicating RSS and Atom Feeds
    4. 7.4. Other Sources of Syndicated Content
    5. 7.5. Social Bookmarking
    6. 7.6. Summary
  13. 8. Black Hat SEO
    1. 8.1. What's with All the Hats?
    2. 8.2. Bending the Rules
    3. 8.3. Technical Analysis of Black-Hat Techniques
      1. 8.3.1. Attack Avoidance
      2. 8.3.2. HTML Insertion Attacks
      3. 8.3.3. Avoiding Comment Attacks Using Nofollow
      4. 8.3.4. Sanitizing User Input
      5. 8.3.5. Requesting Human Input
      6. 8.3.6. 301 Redirect Attacks
      7. 8.3.7. Using a 302 Redirect
      8. 8.3.8. Using robots.txt to Exclude redirect.php
      9. 8.3.9. Using a Database-Driven Solution
      10. 8.3.10. Content Theft
      11. 8.3.11. On Buying Links
      12. 8.3.12. Digital Point Co-op, Link Vault
    4. 8.4. Summary
  14. 9. Sitemaps
    1. 9.1. Traditional Sitemaps
    2. 9.2. Search Engine Sitemaps
      1. 9.2.1. Using Google Sitemaps
      2. 9.2.2. Using Yahoo! Sitemaps
    3. 9.3. Generating Sitemaps Programmatically
    4. 9.4. Informing Google about Updates
    5. 9.5. The Sitemaps.org Standard Protocol
    6. 9.6. Summary
  15. 10. Link Bait
    1. 10.1. Hooking Links
      1. 10.1.1. Informational Hooks
      2. 10.1.2. News Story Hooks
      3. 10.1.3. Humor/Fun Hooks
      4. 10.1.4. Evil Hooks
    2. 10.2. Traditional Examples of Link Bait
    3. 10.3. Interactive Link Bait: Put on Your Programming Hardhat!
    4. 10.4. Case Study: Fortune Cookies
    5. 10.5. Summary
  16. 11. Cloaking, Geo-Targeting, and IP Delivery
    1. 11.1. Cloaking, Geo-Targeting, and IP Delivery
      1. 11.1.1. More on Geo-Targeting
      2. 11.1.2. A Few Words on JavaScript Redirect Cloaking
      3. 11.1.3. The Ethical Debate on Cloaking
      4. 11.1.4. Cloaking Dangers
      5. 11.1.5. Using the Meta Noarchive Tag
    2. 11.2. Implementing Cloaking
    3. 11.3. Cloaking Case Studies
      1. 11.3.1. Rendering Images as Text
      2. 11.3.2. Redirecting Excluded Content
      3. 11.3.3. Feeding Subscription-Based Content Only to Spiders
      4. 11.3.4. Disabling URL-Based Session Handling for Spiders
      5. 11.3.5. Other Cloaking Implementations
    4. 11.4. Implementing Geo-Targeting
    5. 11.5. Summary
  17. 12. Foreign Language SEO
    1. 12.1. Foreign Language Optimization Tips
      1. 12.1.1. Indicating Language and Region
      2. 12.1.2. Server Location and Domain Name
      3. 12.1.3. Include the Address of the Foreign Location if Possible
      4. 12.1.4. Dealing with Accented Letters (Diacritics)
    2. 12.2. Foreign Language Spamming
    3. 12.3. Summary
  18. 13. Coping with Technical Issues
    1. 13.1. Unreliable Web Hosting or DNS
    2. 13.2. Changing Hosting Providers
    3. 13.3. Cross-Linking
    4. 13.4. SEO-Aware Split Testing
    5. 13.5. Detecting Broken Links
    6. 13.6. Summary
  19. 14. Case Study: Building an E-Commerce Store
    1. 14.1. Establishing the Requirements
    2. 14.2. Implementing the Product Catalog
    3. 14.3. Summary
  20. 15. Site Clinic: So You Have a Web Site?
    1. 15.1. 1. Creating Sitemaps
    2. 15.2. 2. Creating News Feeds
    3. 15.3. 3. Fixing Duplication in Titles and Meta Tags
    4. 15.4. 4. Getting Listed in Reputable Directories
    5. 15.5. 5. Soliciting and Exchanging Relevant Links
    6. 15.6. 6. Buying Links
    7. 15.7. 7. Creating Link Bait
    8. 15.8. 8. Adding Social Bookmarking Functionality
    9. 15.9. 9. Starting a Blog and/or Forum
    10. 15.10. 10. Dealing with a Pure Flash or AJAX Site
    11. 15.11. 11. Preventing Black Hat Victimization
    12. 15.12. 12. Examining Your URLs for Problems
    13. 15.13. 13. Looking for Duplicate Content
    14. 15.14. 14. Eliminating Session IDs
    15. 15.15. 15. Tweaking On-page Factors
    16. 15.16. Summary
  21. 16. WordPress: Creating an SE-Friendly Blog
    1. 16.1. Installing WordPress
    2. 16.2. Turning On Permalinks
    3. 16.3. Akismet: Preventing Comment Spam
    4. 16.4. Sociable: Social Bookmarking Icons
    5. 16.5. WP-Email: Email a Friend
    6. 16.6. Chicklet Creator Plugin
    7. 16.7. Sitemap Generator Plugin
    8. 16.8. Google Sitemaps Plugin
    9. 16.9. Digg Button Plugin
    10. 16.10. Pagerfix Plugin
    11. 16.11. Eliminating Duplicate Content
      1. 16.11.1. Pull-downs and Excluding Category Links
      2. 16.11.2. Excerpting Article Content
    12. 16.12. Making the Blog Your Home Page
    13. 16.13. Summary
  22. A. Simple Regular Expressions
    1. A.1. Matching Single Characters
      1. A.1.1. Matching Sequences of Characters That Each Occur Once
      2. A.1.2. Introducing Metacharacters
      3. A.1.3. Matching Sequences of Different Characters
    2. A.2. Matching Optional Characters
      1. A.2.1. Matching Multiple Optional Characters
    3. A.3. Other Cardinality Operators
      1. A.3.1. The * Quantifier
      2. A.3.2. The + Quantifier
    4. A.4. The Curly-Brace Syntax
      1. A.4.1. The {n} Syntax
      2. A.4.2. The {n,m} Syntax
      3. A.4.3. {0,m}
      4. A.4.4. {n,m}
      5. A.4.5. {n,}
  23. Glossary

Product information

  • Title: Professional Search Engine Optimization with PHP: A Developer's Guide to SEO
  • Author(s): Jaimie Sirovich, Cristian Darie
  • Release date: April 2007
  • Publisher(s): Wrox
  • ISBN: 9780470100929