Free tutorials & notes in Hindi & English · Clean code examples 🧰 मुफ़्त PDF और फ़ोटो टूल्स →
⚙️ Module B – Technical SEO और मापना (दिन 5–7)  ·  दिन 05

दिन 5: Technical SEO – robots.txt, Sitemap, Canonical

⏱ 90 min📶 Intermediate🎯 100% self-study
दिन 5 / 10

✅ आज आप सीखेंगे

  • robots.txt से crawling नियंत्रित करना
  • XML sitemap से discovery में मदद
  • Canonical tags से duplicates से बचना
  • noindex, 301 redirects और status codes सही इस्तेमाल
  • hreflang और basic structured data जोड़ना

🏢 असली दुनिया में

Institute ने अपनी site http://www.sharmacomputers.example/tally-course.html से https://sharmacomputers.example/courses/tally/ पर shift की। अब Google को home page के चार versions दिखते हैं, पुराने links 404 errors देते हैं, और Hindi page English page से मुक़ाबला करता है। Technical SEO कुछ lines में यह सब ठीक करता है।

robots.txt – क्या crawl हो सकता है

robots.txt root पर (/robots.txt) होता है और crawlers को बताता है कि कौन से paths crawl न करें। यह security tool नहीं है और page को Google से नहीं हटाता – दूसरी sites link करें तो blocked page भी दिख सकता है। Page को results से बाहर रखने के लिए noindex लगाएँ और उसे crawl होने दें।

robots.txt
User-agent: *
Disallow: /admin/
Disallow: /account/
Allow: /

Sitemap: https://sharmacomputers.example/sitemap.xml
⚠️ एक line की तबाही

Disallow: / पूरी site रोक देता है। Development के बाद यह अक्सर रह जाता है – हर launch के बाद robots.txt जाँचें।

XML sitemap – क्या मिलना चाहिए

Sitemap उन URLs की list है जिन्हें आप index करवाना चाहते हैं (सिर्फ़ canonical, indexable, 200-status pages)। इसे Search Console (Day 7) में submit करें और robots.txt में बताएँ। lastmod ईमानदार रखें – तभी बदलें जब content सच में बदले।

XML
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://sharmacomputers.example/courses/tally/</loc>
    <lastmod>2026-10-20</lastmod>
  </url>
  <url>
    <loc>https://sharmacomputers.example/courses/python/</loc>
    <lastmod>2026-09-12</lastmod>
  </url>
</urlset>

Canonical, noindex और hreflang

समस्यासुधार
हर page के http://, https://, www और non-www versionsसबको एक version पर 301-redirect (नीचे) और self-referencing canonical
?utm_source= या sorting parameters वाला वही pageसाफ़ URL पर canonical
Thank-you page, internal search results, loginnoindex (और sitemap में नहीं)
एक ही page के English और Hindi versionsदोनों pages पर एक-दूसरे की ओर hreflang en/hi, और x-default
HTML
<!-- the preferred URL of this page -->
<link rel="canonical" href="https://sharmacomputers.example/courses/tally/">

<!-- English and Hindi versions of the same page -->
<link rel="alternate" hreflang="en" href="https://sharmacomputers.example/courses/tally/">
<link rel="alternate" hreflang="hi" href="https://sharmacomputers.example/hi/courses/tally/">
<link rel="alternate" hreflang="x-default" href="https://sharmacomputers.example/courses/tally/">

<!-- keep a page out of Google (e.g. thank-you page) -->
<meta name="robots" content="noindex, follow">

Status codes और redirects

CodeमतलबSEO उपयोग
200OKसामान्य page
301स्थायी रूप से हटाPage हमेशा के लिए shift – signals नए URL को
302 / 307अस्थायीसिर्फ़ थोड़े समय के लिए (जैसे sale page)
404नहीं मिलाबिना विकल्प हटाया page – सच में हटा हो तो ठीक; मिलता-जुलता page हो तो redirect
410Goneजान-बूझकर हमेशा के लिए हटाया
5xxServer errorजल्दी ठीक करें – बार-बार errors से crawling धीमी
Apache .htaccess
# Force HTTPS and one host name (Apache .htaccess)
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https://sharmacomputers.example%{REQUEST_URI} [L,R=301]

# Old URL moved permanently to the new one
Redirect 301 /tally-course.html /courses/tally/
💼 Office में कैसे होता है – professional tipURLs बदलने से पहले spreadsheet बनाएँ: पुराना URL → नया URL। हर पुराने URL को सबसे नज़दीकी नए page पर redirect करें (सबको home page पर नहीं), internal links बदलें, और sitemap दोबारा submit करें। Migration में redirects छूटना traffic अचानक गिरने का सबसे आम कारण है।

HTTPS और structured data

HTTPS ज़रूरी है – browsers HTTP pages को “Not secure” दिखाते हैं और यह हल्का ranking signal है। Structured data (schema.org वाला JSON-LD) page को machine-readable तरीके से बताता है और rich results के लायक बना सकता है। सिर्फ़ वही जोड़ें जो page पर सच और दिखता हो, और Google के Rich Results Test से जाँचें।

JSON-LD
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "EducationalOrganization",
  "name": "Sharma Computer Institute",
  "url": "https://sharmacomputers.example/",
  "logo": "https://sharmacomputers.example/images/logo.png",
  "telephone": "+91-00000-00000",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "Shop 4, Example Market",
    "addressLocality": "Aligarh",
    "addressRegion": "Uttar Pradesh",
    "postalCode": "202001",
    "addressCountry": "IN"
  }
}
</script>
ℹ️ Rich results बदलते रहते हैं

कौन से rich result types दिखें यह Google तय करता है। जैसे, FAQ और HowTo rich results अब बहुत कम sites के लिए दिखते हैं। समय लगाने से पहले Google Search Central में supported structured-data features की list देखें।

हल किए उदाहरण

उदाहरण 1: Migration की जाँच

लक्षणकारणसुधार
पुराने /tally-course.html links 404 देते हैंURL बदलने के बाद redirect नहींRedirect 301 /tally-course.html /courses/tally/
Search Console: “Duplicate without user-selected canonical”http/https और www/non-www सब चालू301 से एक host + self canonical
3 हफ़्ते बाद भी नए course pages indexed नहींSitemap में नहीं और internal links नहींSitemap में जोड़ें, /courses/ और home page से link करें
पूरी site Google से ग़ायबStaging से बचा robots.txt Disallow: /हटाएँ, फिर मुख्य pages की indexing request करें

अभ्यास प्रश्न (बिना हल – उत्तर छिपा है)

हर प्रश्न पहले ख़ुद करें – कागज़ पर, text editor में या अपनी site पर – फिर उत्तर खोलकर जाँचें।

🏋️ Practice – ख़ुद करें

Task 1: ऐसा robots.txt लिखिए जो सभी crawlers के लिए /cart/ और /search/ रोके, बाकी सब allow करे, और https://sharmacomputers.example/sitemap.xml बताए।
Solution देखें
robots.txt
User-agent: *
Disallow: /cart/
Disallow: /search/
Allow: /

Sitemap: https://sharmacomputers.example/sitemap.xml
Task 2: कौन सा इस्तेमाल करेंगे – 301, 302, noindex या canonical? (a) course page हमेशा के लिए shift (b) 10 दिन का Diwali offer page (c) article की printer-friendly copy (d) “enquiry के लिए धन्यवाद” page।
Solution देखें(a) 301 (b) 302 (अस्थायी) (c) मुख्य article पर canonical (d) noindex।
Task 3: आपकी site पर English pages और /hi/… पर Hindi pages हैं। Python course page के लिए hreflang tags लिखिए।
Solution देखें
HTML
<link rel="alternate" hreflang="en" href="https://sharmacomputers.example/courses/python/">
<link rel="alternate" hreflang="hi" href="https://sharmacomputers.example/hi/courses/python/">
<link rel="alternate" hreflang="x-default" href="https://sharmacomputers.example/courses/python/">

यही set English और Hindi दोनों pages पर लगाएँ।

🏅 आज के Job Skills

✔ robots.txt और sitemaps लिखना✔ canonical, noindex और hreflang✔ 301/302 और status codes✔ Structured data जोड़ना और जाँचना

Quick quiz

🧠 Quick Quiz – ख़ुद को जाँचें

1. robots.txt किसलिए?
यह security या de-indexing नहीं।
2. हमेशा के लिए shift हुए page के लिए:
301 = स्थायी।
3. Page को Google results से बाहर रखने के लिए:
noindex दिखने के लिए page crawl होना चाहिए।
4. hreflang Google को बताता है:
जैसे en और hi versions।

Interview corner

💼 Interview Corner

robots.txt Disallow और noindex में क्या अंतर है?

Disallow crawling रोकता है पर links से URL फिर भी index हो सकता है; noindex Google को page crawl करने देता है और results में न दिखाने को कहता है। De-index के लिए noindex लगाएँ और page block न करें।

Site migration कैसे संभालते हैं?

हर पुराने URL को सबसे नज़दीकी नए URL से map करें, 301 redirects लगाएँ, internal links और canonicals बदलें, robots.txt खुला रखें, नया sitemap submit करें, और Search Console में 404s और coverage बदलाव देखते रहें।

सारांश

  • robots.txt crawling नियंत्रित करता है, indexing नहीं।
  • Sitemap में canonical, indexable URLs।
  • हर URL का एक version: 301 + canonical; भाषाओं के लिए hreflang।
  • HTTPS हमेशा; structured data सिर्फ़ सच्चे, दिखने वाले तथ्यों के लिए।
➡️ आगे

Day 6: page speed, mobile-friendliness और Core Web Vitals (LCP, INP, CLS)।

अक्सर पूछे जाने वाले प्रश्न (FAQ)

क्या rank के लिए structured data ज़रूरी है?
नहीं। यह Google को page समझने में मदद करता है और rich results दिला सकता है, पर अच्छा content और crawl होने लायक site कहीं ज़्यादा ज़रूरी हैं।
Sitemap कितनी बार update हो?
जब भी pages जुड़ें या बदलें, अपने-आप। ज़्यादातर CMS यह करते हैं; वरना हर update के बाद दोबारा बनाएँ।
← SEO in 10 Days
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

अगला topicदिन 6: Page Speed और Core Web Vitals आपकी प्रगति: 5 / 10 (50%) · Lesson 6 / 10 आगे बढ़ें →

यह lesson कैसा लगा?

आपकी राय से हम content और बेहतर बनाते हैं।

अपना review और सुझाव लिखें (वैकल्पिक)

Review approve होने के बाद आपका नाम और शहर इसके साथ public दिख सकते हैं। Email या phone न लिखें।

▶ CodingEasily on YouTube

Video से सीखें – आसान Hindi में

चुनी हुई video: RDBMS भाग 3 – Class XI Commerce IT

▶ Channel subscribe करें