instruction: How do I implement SEO-friendly breadcrumbs?

output:
# SEO-Friendly Breadcrumbs Implementation

## HTML Structure
```html
<nav aria-label="Breadcrumb" class="breadcrumb">
  <ol itemscope itemtype="https://schema.org/BreadcrumbList">
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
      <a itemprop="item" href="/"><span itemprop="name">Home</span></a>
      <meta itemprop="position" content="1" />
    </li>
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
      <a itemprop="item" href="/products"><span itemprop="name">Products</span></a>
      <meta itemprop="position" content="2" />
    </li>
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
      <span itemprop="name">Current Page</span>
      <meta itemprop="position" content="3" />
    </li>
  </ol>
</nav>
```

## JSON-LD Schema (Preferred)
```html
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {"@type": "ListItem", "position": 1, "name": "Home", "item": "https://example.com/"},
    {"@type": "ListItem", "position": 2, "name": "Products", "item": "https://example.com/products"},
    {"@type": "ListItem", "position": 3, "name": "Widget X"}
  ]
}
</script>
```

## CSS Styling
```css
.breadcrumb ol { display: flex; list-style: none; padding: 0; }
.breadcrumb li:not(:last-child)::after { content: "›"; margin: 0 0.5rem; color: #666; }
.breadcrumb a { color: #0066cc; text-decoration: none; }
.breadcrumb li:last-child { color: #333; font-weight: 500; }
```

## Best Practices
1. Include on all pages except homepage
2. Use hierarchical structure matching site navigation
3. Make all levels clickable except current page
4. Keep breadcrumb text concise
5. Always include structured data for rich snippets

topic: breadcrumbs

type: implementation


instruction: What semantic HTML elements should I use for SEO?

output:
# Semantic HTML for SEO

## Document Structure
```html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Page Title | Brand Name</title>
  <meta name="description" content="155 character description...">
  <link rel="canonical" href="https://example.com/page">
</head>
<body>
  <header>
    <nav aria-label="Main navigation">...</nav>
  </header>

  <main>
    <article>
      <header>
        <h1>Single H1 Per Page</h1>
        <time datetime="2024-01-15">January 15, 2024</time>
      </header>
      <section>
        <h2>Section Heading</h2>
        <p>Content...</p>
      </section>
    </article>
    <aside>Sidebar content</aside>
  </main>

  <footer>
    <nav aria-label="Footer navigation">...</nav>
  </footer>
</body>
</html>
```

## Key Semantic Elements
| Element | Purpose | SEO Impact |
|---------|---------|------------|
| `<header>` | Page/section header | Defines main branding area |
| `<nav>` | Navigation links | Helps crawlers understand structure |
| `<main>` | Main content | Signals primary content area |
| `<article>` | Self-contained content | Indicates complete, shareable content |
| `<section>` | Thematic grouping | Organizes related content |
| `<aside>` | Related content | Secondary information |
| `<footer>` | Page/section footer | Copyright, links, contact |
| `<h1>-<h6>` | Headings hierarchy | Critical for content structure |
| `<time>` | Date/time | Machine-readable dates |
| `<address>` | Contact info | Local SEO signal |

## Heading Hierarchy Rules
- Only ONE `<h1>` per page
- Don't skip levels (h1 → h3)
- Use headings for structure, not styling

type: guide


instruction: What are all the essential meta tags for SEO?

output:
# Essential Meta Tags for SEO

## Required Meta Tags
```html
<head>
  <!-- Character encoding -->
  <meta charset="UTF-8">

  <!-- Responsive design -->
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <!-- Page title (50-60 chars) -->
  <title>Primary Keyword - Secondary Keyword | Brand</title>

  <!-- Meta description (150-160 chars) -->
  <meta name="description" content="Compelling description with keywords that encourages clicks from search results.">

  <!-- Canonical URL -->
  <link rel="canonical" href="https://example.com/page">

  <!-- Robots directive -->
  <meta name="robots" content="index, follow">
</head>
```

## Open Graph (Social Sharing)
```html
<meta property="og:title" content="Page Title">
<meta property="og:description" content="Description for social shares">
<meta property="og:image" content="https://example.com/image.jpg">
<meta property="og:url" content="https://example.com/page">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Brand Name">
```

## Twitter Cards
```html
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Page Title">
<meta name="twitter:description" content="Description">
<meta name="twitter:image" content="https://example.com/image.jpg">
<meta name="twitter:site" content="@username">
```

## Additional Important Tags
```html
<!-- Language alternatives -->
<link rel="alternate" hreflang="en" href="https://example.com/en/page">
<link rel="alternate" hreflang="es" href="https://example.com/es/page">

<!-- Favicon -->
<link rel="icon" href="/favicon.ico">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">

<!-- Preconnect for performance -->
<link rel="preconnect" href="https://fonts.googleapis.com">
```

type: reference


instruction: How do I implement structured data schema markup?

output:
# Structured Data Implementation Guide

## Common Schema Types

### Organization
```json
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Company Name",
  "url": "https://example.com",
  "logo": "https://example.com/logo.png",
  "sameAs": [
    "https://facebook.com/company",
    "https://twitter.com/company",
    "https://linkedin.com/company/company"
  ],
  "contactPoint": {
    "@type": "ContactPoint",
    "telephone": "+1-800-555-1234",
    "contactType": "customer service"
  }
}
```

### Article/Blog Post
```json
{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "Article Title",
  "image": "https://example.com/image.jpg",
  "author": {"@type": "Person", "name": "Author Name"},
  "publisher": {
    "@type": "Organization",
    "name": "Publisher",
    "logo": {"@type": "ImageObject", "url": "https://example.com/logo.png"}
  },
  "datePublished": "2024-01-15",
  "dateModified": "2024-01-20"
}
```

### Product
```json
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Product Name",
  "image": "https://example.com/product.jpg",
  "description": "Product description",
  "brand": {"@type": "Brand", "name": "Brand"},
  "offers": {
    "@type": "Offer",
    "price": "99.99",
    "priceCurrency": "USD",
    "availability": "https://schema.org/InStock"
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.5",
    "reviewCount": "89"
  }
}
```

### FAQ Page
```json
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What is your return policy?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "We offer 30-day returns..."
      }
    }
  ]
}
```

### Local Business
```json
{
  "@context": "https://schema.org",
  "@type": "LocalBusiness",
  "name": "Business Name",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "123 Main St",
    "addressLocality": "City",
    "addressRegion": "State",
    "postalCode": "12345"
  },
  "geo": {"@type": "GeoCoordinates", "latitude": "40.7128", "longitude": "-74.0060"},
  "openingHours": "Mo-Fr 09:00-17:00"
}
```

## Implementation
Place JSON-LD in `<head>` or before closing `</body>`:
```html
<script type="application/ld+json">
{ ... schema here ... }
</script>
```


instruction: How do I optimize Core Web Vitals for SEO?

output:
# Core Web Vitals Optimization

## The Three Metrics

### LCP (Largest Contentful Paint) - Target: <2.5s
Measures loading performance.

**Optimization:**
```html
<!-- Preload hero image -->
<link rel="preload" as="image" href="/hero.webp">

<!-- Use modern formats -->
<picture>
  <source srcset="image.avif" type="image/avif">
  <source srcset="image.webp" type="image/webp">
  <img src="image.jpg" alt="Description" loading="eager">
</picture>
```

```css
/* Optimize fonts */
@font-face {
  font-family: 'CustomFont';
  src: url('font.woff2') format('woff2');
  font-display: swap;
}
```

### FID/INP (Interaction to Next Paint) - Target: <200ms
Measures interactivity.

**Optimization:**
```javascript
// Break up long tasks
function processData(items) {
  const chunk = items.splice(0, 100);
  // Process chunk
  if (items.length > 0) {
    requestIdleCallback(() => processData(items));
  }
}

// Defer non-critical JS
<script src="analytics.js" defer></script>
```

### CLS (Cumulative Layout Shift) - Target: <0.1
Measures visual stability.

**Optimization:**
```html
<!-- Always set dimensions -->
<img src="image.jpg" width="800" height="600" alt="...">

<!-- Reserve space for ads -->
<div style="min-height: 250px;">
  <!-- Ad loads here -->
</div>
```

```css
/* Prevent font swap shift */
.text { font-synthesis: none; }

/* Aspect ratio for responsive images */
.image-container {
  aspect-ratio: 16 / 9;
}
```

## Quick Wins Checklist
- [ ] Compress and serve images in WebP/AVIF
- [ ] Enable Gzip/Brotli compression
- [ ] Use CDN for static assets
- [ ] Lazy load below-fold images
- [ ] Minimize render-blocking resources
- [ ] Set explicit image dimensions
- [ ] Use font-display: swap

type: optimization


instruction: What's the best URL structure for SEO?

output:
# SEO-Friendly URL Structure

## URL Best Practices

### Good URL Examples
```
https://example.com/products/blue-widget
https://example.com/blog/how-to-optimize-seo
https://example.com/services/web-design
```

### Bad URL Examples
```
https://example.com/p?id=12345
https://example.com/blog/post/2024/01/15/this-is-a-very-long-url-that-goes-on-forever
https://example.com/Category/Sub_Category/Product%20Name
```

## URL Rules
| Rule | Good | Bad |
|------|------|-----|
| Lowercase | /products/widget | /Products/Widget |
| Hyphens | /blue-widget | /blue_widget or /bluewidget |
| Short | /seo-guide | /the-complete-guide-to-seo-optimization-2024 |
| Descriptive | /running-shoes | /product/12345 |
| No special chars | /cafe-menu | /café-menu |
| No trailing slash | /page | /page/ |

## Folder Structure
```
/                          # Homepage
/about                     # About page
/products                  # Products landing
/products/category         # Category page
/products/category/item    # Product page
/blog                      # Blog index
/blog/post-title           # Blog post
```

## Technical Implementation
```html
<!-- Canonical URL -->
<link rel="canonical" href="https://example.com/products/widget">

<!-- Redirect www to non-www (or vice versa) -->
<!-- In .htaccess or server config -->
```

```javascript
// URL slug generation
function generateSlug(title) {
  return title
    .toLowerCase()
    .replace(/[^a-z0-9]+/g, '-')
    .replace(/^-|-$/g, '')
    .substring(0, 60);
}
```


instruction: How do I create an effective internal linking structure?

output:
# Internal Linking Strategy for SEO

## Link Architecture
```
Homepage
├── Category Pages (linked from nav)
│   ├── Subcategory Pages
│   │   └── Product/Content Pages (interlinked)
│   └── Related Categories (cross-linked)
└── Footer Links (legal, contact, sitemap)
```

## Best Practices

### 1. Descriptive Anchor Text
```html
<!-- Good -->
<a href="/seo-guide">complete SEO guide</a>

<!-- Bad -->
<a href="/seo-guide">click here</a>
<a href="/seo-guide">read more</a>
```

### 2. Contextual Relevance
Link to related content within body paragraphs, not just navigation.

### 3. Follow Link Hierarchy
- Homepage → Category → Subcategory → Detail pages
- 3 clicks max to any page

### 4. Link to Important Pages
Prioritize linking to:
- High-converting pages
- Pillar content
- New content (for indexing)

## Implementation Pattern
```html
<article>
  <p>
    When implementing <a href="/structured-data-guide">structured data</a>,
    you should also consider your <a href="/site-speed-optimization">site speed</a>.
    Learn more about <a href="/core-web-vitals">Core Web Vitals</a> requirements.
  </p>

  <aside class="related-posts">
    <h3>Related Articles</h3>
    <ul>
      <li><a href="/post-1">Related Post 1</a></li>
      <li><a href="/post-2">Related Post 2</a></li>
    </ul>
  </aside>
</article>
```

## Link Audit Checklist
- [ ] No orphan pages (pages with no internal links)
- [ ] No broken links (404s)
- [ ] Important pages have most internal links
- [ ] Anchor text is varied and descriptive
- [ ] Navigation is crawlable (no JS-only links)

type: strategy


instruction: How do I optimize images for SEO?

output:
# Image SEO Optimization

## File Optimization
```bash
# Convert to WebP
cwebp -q 80 image.jpg -o image.webp

# Resize for web
convert image.jpg -resize 1200x800 -quality 85 image-optimized.jpg
```

## HTML Implementation
```html
<!-- Responsive images with srcset -->
<img
  src="image-800.jpg"
  srcset="image-400.jpg 400w, image-800.jpg 800w, image-1200.jpg 1200w"
  sizes="(max-width: 600px) 400px, (max-width: 1200px) 800px, 1200px"
  alt="Descriptive alt text with keywords"
  width="800"
  height="600"
  loading="lazy"
>

<!-- Picture element for format fallback -->
<picture>
  <source srcset="image.avif" type="image/avif">
  <source srcset="image.webp" type="image/webp">
  <img src="image.jpg" alt="Description" width="800" height="600">
</picture>
```

## Alt Text Best Practices
```html
<!-- Good alt text -->
<img alt="Red Nike running shoes on white background" ...>

<!-- Bad alt text -->
<img alt="shoe" ...>
<img alt="IMG_2847.jpg" ...>
<img alt="" ...>  <!-- Only for decorative images -->
```

## File Naming
```
<!-- Good -->
red-nike-running-shoes.jpg
2024-annual-report-infographic.png

<!-- Bad -->
IMG_2847.jpg
image1.png
```

## Image Sitemap
```xml
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
  <url>
    <loc>https://example.com/page</loc>
    <image:image>
      <image:loc>https://example.com/image.jpg</image:loc>
      <image:title>Image Title</image:title>
      <image:caption>Image caption</image:caption>
    </image:image>
  </url>
</urlset>
```

## Optimization Checklist
- [ ] Compress all images (80-85% quality)
- [ ] Use WebP/AVIF with fallbacks
- [ ] Include width/height attributes
- [ ] Add descriptive alt text
- [ ] Use lazy loading for below-fold
- [ ] Descriptive file names
- [ ] Serve from CDN


instruction: How do I optimize a website for mobile SEO?

output:
# Mobile SEO Optimization

## Responsive Design
```html
<meta name="viewport" content="width=device-width, initial-scale=1.0">
```

```css
/* Mobile-first approach */
.container { width: 100%; padding: 1rem; }

@media (min-width: 768px) {
  .container { max-width: 720px; margin: 0 auto; }
}

@media (min-width: 1024px) {
  .container { max-width: 960px; }
}
```

## Touch-Friendly Design
```css
/* Minimum tap target size: 48x48px */
.button, .link {
  min-height: 48px;
  min-width: 48px;
  padding: 12px 24px;
}

/* Adequate spacing between targets */
.nav-links a {
  margin: 8px 0;
}
```

## Mobile Performance
```html
<!-- Preload critical resources -->
<link rel="preload" href="critical.css" as="style">
<link rel="preload" href="hero-mobile.webp" as="image" media="(max-width: 768px)">

<!-- Defer non-critical JS -->
<script src="app.js" defer></script>
```

## Avoid Mobile Issues
```css
/* Prevent horizontal scroll */
body { overflow-x: hidden; }
img { max-width: 100%; height: auto; }

/* Readable font sizes */
body { font-size: 16px; line-height: 1.6; }

/* No fixed-width elements */
.bad { width: 500px; }  /* ✗ */
.good { max-width: 100%; } /* ✓ */
```

## Mobile Testing
1. Google Mobile-Friendly Test
2. Chrome DevTools Device Mode
3. Real device testing
4. PageSpeed Insights (mobile tab)

## Common Issues to Fix
- [ ] Viewport meta tag present
- [ ] No horizontal scrolling
- [ ] Tap targets properly sized
- [ ] Font sizes readable (16px+)
- [ ] No intrusive interstitials
- [ ] Fast load time (<3s on 4G)


instruction: How do I create and optimize an XML sitemap?

output:
# XML Sitemap Implementation

## Basic Sitemap Structure
```xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <lastmod>2024-01-15</lastmod>
    <changefreq>weekly</changefreq>
    <priority>1.0</priority>
  </url>
  <url>
    <loc>https://example.com/products</loc>
    <lastmod>2024-01-14</lastmod>
    <changefreq>daily</changefreq>
    <priority>0.8</priority>
  </url>
</urlset>
```

## Sitemap Index (for large sites)
```xml
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://example.com/sitemap-pages.xml</loc>
    <lastmod>2024-01-15</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://example.com/sitemap-posts.xml</loc>
    <lastmod>2024-01-15</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://example.com/sitemap-products.xml</loc>
    <lastmod>2024-01-15</lastmod>
  </sitemap>
</sitemapindex>
```

## Priority Guidelines
| Page Type | Priority |
|-----------|----------|
| Homepage | 1.0 |
| Category pages | 0.8 |
| Product/service pages | 0.7 |
| Blog posts | 0.6 |
| About/contact | 0.5 |
| Legal pages | 0.3 |

## robots.txt Reference
```
User-agent: *
Allow: /

Sitemap: https://example.com/sitemap.xml
```

## Submission
1. Google Search Console → Sitemaps → Add
2. Bing Webmaster Tools → Sitemaps → Submit

## Best Practices
- Max 50,000 URLs per sitemap
- Max 50MB uncompressed
- Use gzip compression for large sitemaps
- Update lastmod only when content changes
- Include only canonical, indexable URLs
- Exclude noindex, redirected, or error pages

topic: sitemap


instruction: How do I configure robots.txt for SEO?

output:
# robots.txt Configuration Guide

## Basic Structure
```
# robots.txt for example.com

User-agent: *
Allow: /
Disallow: /admin/
Disallow: /private/
Disallow: /api/
Disallow: /search?
Disallow: /*?utm_*

Sitemap: https://example.com/sitemap.xml
```

## Common Directives
```
# Block all crawlers from a directory
Disallow: /secret/

# Block only Googlebot
User-agent: Googlebot
Disallow: /no-google/

# Block all crawlers except Googlebot
User-agent: *
Disallow: /
User-agent: Googlebot
Allow: /

# Crawl delay (not supported by Google)
User-agent: Bingbot
Crawl-delay: 10
```

## What to Block
```
Disallow: /admin/           # Admin areas
Disallow: /cart/            # Shopping cart
Disallow: /checkout/        # Checkout process
Disallow: /account/         # User accounts
Disallow: /api/             # API endpoints
Disallow: /search           # Search results
Disallow: /*?sort=          # Sorted/filtered pages
Disallow: /*?page=          # Pagination params
Disallow: /thank-you        # Thank you pages
Disallow: /*.pdf$           # PDFs (optional)
```

## What NOT to Block
```
# Never block these
Allow: /css/
Allow: /js/
Allow: /images/
Allow: /*.css
Allow: /*.js
```

## Testing
1. Use Google Search Console robots.txt Tester
2. Verify: `https://example.com/robots.txt`

## Common Mistakes
- Blocking CSS/JS (breaks rendering)
- Using robots.txt for security (not secure!)
- Blocking crawlers from sitemaps
- Typos in directory names

type: configuration


instruction: How does accessibility improve SEO?

output:
# Accessibility for SEO

## Overlap Between A11y and SEO

### Alt Text
```html
<!-- Helps screen readers AND image search -->
<img src="chart.png" alt="Bar chart showing 50% growth in Q4 2024">
```

### Heading Structure
```html
<!-- Logical hierarchy helps both -->
<h1>Main Topic</h1>
  <h2>Subtopic 1</h2>
    <h3>Detail 1.1</h3>
  <h2>Subtopic 2</h2>
```

### Descriptive Links
```html
<!-- Good for screen readers AND anchor text SEO -->
<a href="/pricing">View our pricing plans</a>

<!-- Bad -->
<a href="/pricing">Click here</a>
```

### Semantic HTML
```html
<nav aria-label="Main">...</nav>
<main>...</main>
<aside>...</aside>
<footer>...</footer>
```

## ARIA Landmarks
```html
<header role="banner">
<nav role="navigation" aria-label="Primary">
<main role="main">
<aside role="complementary">
<footer role="contentinfo">
```

## Form Accessibility
```html
<form>
  <label for="email">Email Address</label>
  <input type="email" id="email" name="email" required
         aria-describedby="email-hint">
  <span id="email-hint">We'll never share your email</span>
</form>
```

## Skip Links
```html
<a href="#main-content" class="skip-link">Skip to main content</a>
```

```css
.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 0;
  top: 0;
  padding: 8px;
  background: #000;
  color: #fff;
}
```

## Key Benefits
1. Better user experience → Lower bounce rate
2. Semantic markup → Better crawlability
3. Alt text → Image SEO
4. Descriptive links → Better anchor text
5. Keyboard accessible → Works without JS


instruction: How do I improve page speed for better SEO rankings?

output:
# Page Speed Optimization for SEO

## Critical Rendering Path
```html
<head>
  <!-- Critical CSS inline -->
  <style>
    /* Above-the-fold styles only */
    body { margin: 0; font-family: system-ui; }
    header { background: #333; color: white; }
  </style>

  <!-- Defer non-critical CSS -->
  <link rel="preload" href="styles.css" as="style" onload="this.onload=null;this.rel='stylesheet'">

  <!-- Preload critical resources -->
  <link rel="preload" href="hero.webp" as="image">
  <link rel="preconnect" href="https://fonts.googleapis.com">
</head>
```

## JavaScript Optimization
```html
<!-- Defer non-critical JS -->
<script src="analytics.js" defer></script>

<!-- Async for independent scripts -->
<script src="chat-widget.js" async></script>

<!-- Critical JS inline -->
<script>
  // Minimal inline JS for above-fold interactivity
</script>
```

## Image Optimization
```html
<img
  src="placeholder.jpg"
  data-src="actual-image.webp"
  loading="lazy"
  width="800" height="600"
  alt="Description"
>
```

## Caching Headers
```
# .htaccess
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/webp "access plus 1 year"
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
</IfModule>
```

## Compression
```
# Enable Brotli (preferred) or Gzip
<IfModule mod_brotli.c>
  AddOutputFilterByType BROTLI_COMPRESS text/html text/css application/javascript
</IfModule>
```

## Quick Wins
| Action | Impact |
|--------|--------|
| Enable compression | -70% file size |
| Optimize images | -50% image size |
| Use CDN | -30% latency |
| Browser caching | Faster repeat visits |
| Minify CSS/JS | -20% file size |
| Lazy load images | Faster initial load |

## Testing Tools
1. PageSpeed Insights
2. GTmetrix
3. WebPageTest
4. Chrome DevTools Performance


instruction: How does HTTPS and security affect SEO?

output:
# HTTPS & Security for SEO

## HTTPS Implementation
```
# Redirect HTTP to HTTPS
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
```

## Security Headers
```html
<!-- In server config or meta tags -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'">
<meta http-equiv="X-Content-Type-Options" content="nosniff">
<meta http-equiv="X-Frame-Options" content="SAMEORIGIN">
```

```
# .htaccess security headers
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
Header always set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options "SAMEORIGIN"
Header always set X-XSS-Protection "1; mode=block"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
```

## SSL Certificate Checklist
- [ ] Valid SSL certificate (not expired)
- [ ] Certificate matches domain
- [ ] Full chain certificate installed
- [ ] No mixed content (HTTP on HTTPS pages)
- [ ] HSTS header enabled
- [ ] HTTP → HTTPS redirects in place

## SEO Impact
| Factor | Impact |
|--------|--------|
| HTTPS | Ranking signal (minor) |
| Page security | Trust signal |
| Mixed content | Can cause issues |
| Expired cert | Browser warnings = lost traffic |

## Common Issues
1. Mixed content warnings
2. Redirect chains (HTTP → HTTPS → www)
3. Canonical URLs not updated to HTTPS
4. Internal links still pointing to HTTP
5. Sitemap URLs not updated


instruction: How do I implement hreflang for international SEO?

output:
# International SEO with hreflang

## hreflang Implementation
```html
<head>
  <!-- Current page in multiple languages -->
  <link rel="alternate" hreflang="en" href="https://example.com/page">
  <link rel="alternate" hreflang="es" href="https://example.com/es/page">
  <link rel="alternate" hreflang="fr" href="https://example.com/fr/page">
  <link rel="alternate" hreflang="de" href="https://example.de/page">

  <!-- Default fallback -->
  <link rel="alternate" hreflang="x-default" href="https://example.com/page">
</head>
```

## URL Structures
```
# Subdirectories (Recommended)
example.com/en/
example.com/es/
example.com/fr/

# Subdomains
en.example.com
es.example.com

# ccTLDs (Country-specific)
example.com (US)
example.co.uk (UK)
example.de (Germany)
```

## Language + Region Codes
```html
<!-- Language only -->
hreflang="en"
hreflang="es"

<!-- Language + Region -->
hreflang="en-US"
hreflang="en-GB"
hreflang="es-MX"
hreflang="es-ES"
```

## XML Sitemap Method
```xml
<url>
  <loc>https://example.com/page</loc>
  <xhtml:link rel="alternate" hreflang="en" href="https://example.com/page"/>
  <xhtml:link rel="alternate" hreflang="es" href="https://example.com/es/page"/>
  <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/page"/>
</url>
```

## Common Mistakes
- Missing return links (A→B but not B→A)
- Incorrect language codes
- Forgetting x-default
- Different content on same hreflang
- Using hreflang for same-language regions only

## Validation
Use Google Search Console's International Targeting report


instruction: How do I optimize a website for local SEO?

output:
# Local SEO Optimization

## Google Business Profile
- Claim and verify listing
- Complete all information
- Add photos regularly
- Respond to reviews
- Post updates weekly

## Local Schema Markup
```json
{
  "@context": "https://schema.org",
  "@type": "LocalBusiness",
  "name": "Business Name",
  "image": "https://example.com/photo.jpg",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "123 Main St",
    "addressLocality": "New York",
    "addressRegion": "NY",
    "postalCode": "10001",
    "addressCountry": "US"
  },
  "geo": {
    "@type": "GeoCoordinates",
    "latitude": "40.7128",
    "longitude": "-74.0060"
  },
  "url": "https://example.com",
  "telephone": "+1-212-555-1234",
  "openingHoursSpecification": [
    {
      "@type": "OpeningHoursSpecification",
      "dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
      "opens": "09:00",
      "closes": "17:00"
    }
  ]
}
```

## NAP Consistency
Ensure Name, Address, Phone is IDENTICAL everywhere:
- Website
- Google Business Profile
- Yelp
- Facebook
- Industry directories
- Local citations

## Local Content
- City/neighborhood pages
- Local event coverage
- Community involvement
- Local case studies
- Area-specific services

## Local Keywords
```html
<title>Plumber in Brooklyn, NY | Company Name</title>
<meta name="description" content="Brooklyn's trusted plumber serving Park Slope, Williamsburg, and DUMBO. 24/7 emergency service. Call 555-1234.">

<h1>Professional Plumbing Services in Brooklyn</h1>
```

## Review Strategy
1. Ask satisfied customers
2. Make it easy (direct links)
3. Respond to all reviews
4. Address negative reviews professionally


instruction: What are the key SEO elements for e-commerce websites?

output:
# E-Commerce SEO Essentials

## Product Page Optimization
```html
<head>
  <title>Blue Running Shoes - Nike Air Max | Store Name</title>
  <meta name="description" content="Nike Air Max running shoes in blue. Free shipping over $50. 30-day returns. In stock and ready to ship.">
  <link rel="canonical" href="https://store.com/products/nike-air-max-blue">
</head>
```

## Product Schema
```json
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Nike Air Max",
  "image": ["front.jpg", "side.jpg", "back.jpg"],
  "description": "Premium running shoes...",
  "sku": "NIKE-AM-001",
  "brand": {"@type": "Brand", "name": "Nike"},
  "offers": {
    "@type": "Offer",
    "url": "https://store.com/products/nike-air-max",
    "priceCurrency": "USD",
    "price": "129.99",
    "availability": "https://schema.org/InStock",
    "seller": {"@type": "Organization", "name": "Store Name"}
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.5",
    "reviewCount": "89"
  }
}
```

## Category Pages
- Unique descriptions (not just product lists)
- Faceted navigation with proper canonicals
- Pagination with rel="next/prev"
- Include relevant keywords naturally

## Common E-Commerce Issues
1. **Duplicate content**: Product variants, sorting, filtering
2. **Thin content**: Auto-generated descriptions
3. **Crawl budget**: Faceted navigation creating millions of URLs
4. **Out of stock**: Handle with 404, redirect, or hide

## Faceted Navigation
```html
<!-- Block filter combinations in robots.txt + noindex -->
<meta name="robots" content="noindex, follow">

<!-- Or use canonical to main category -->
<link rel="canonical" href="https://store.com/shoes">
```

## Key Pages Checklist
- [ ] Unique product descriptions
- [ ] High-quality images with alt text
- [ ] Customer reviews
- [ ] Clear pricing and availability
- [ ] Related products section
- [ ] Breadcrumb navigation
- [ ] Mobile-optimized checkout