← Back to Links Chapter
Link Types

📁 Relative URLs — Paas Hi Paas

href="biryani-recipe.html"

Relative URL apne area mein directions dena hai. "Bhai, us gali mein left lo, third building." Poori address ki zaroorat nahi kyunki tum wahi paas ho.

Relative URLs tumhari WEBSITE ki files ko point karte hain. https:// ki zaroorat nahi. Browser current file kahan hai uske basis pe full path calculate karta hai.

🛺
Hyderabad Analogy: Tum Paradise Biryani mein ho. Koi pucha "Parking kahan hai?" Tumne kaha "Peeche se left." Yeh relative hai — poori address nahi di kyunki tum wahi ho.

Code Example

HTML — Relative URLs — Paas Hi Paas
<!-- Same folder -->
<a href="biryani-recipe.html">Biryani Recipe</a>

<!-- Folder ke andar -->
<a href="recipes/biryani.html">Biryani Recipe</a>

<!-- Ek folder upar -->
<a href="../about.html">About Us</a>

<!-- Upar phir doosre folder mein -->
<a href="../contact/phone.html">Contact Us</a>
recipe.htmlSame folder — current file ke saath wahi
recipes/biryani.htmlSubfolder — "recipes" folder ke andar
../about.htmlParent folder — ek level upar jaao
../contact/phone.htmlUpar jaao phir "contact" mein jao

✅ When to Use

  • Apni website ki pages ke beech link karna
  • Navigation menu links (Home, About, Contact)
  • Blog ke andar internal article links

❌ When NOT to Use

  • Doosri websites se link (absolute use karo)
  • Emails mein links (unhe full URL chahiye kaam karne ke liye)
💡
Apni site ke liye relative URLs use karo. Kyun? Agar domain badla devinhyderabad.com se devinhyd.in — sab absolute URLs toot jaayengi. Relative URLs chalegi!