URL in HTML

URL Kya Hota Hai?

A URL in HTML is used to locate resources on the internet.URL ka full form hai Uniform Resource Locator. Simple words me bole to URL matlab web address.

Example:

Log normally website ka naam type karte hain kyunki naam yaad rakhna easy hota hai numbers se.


Structure of a URL in HTML

Ek URL ka format kuch aisa hota hai:

Structure of URL

Example:

URL in HTML

Iska Breakdown Samjho:

  • scheme β†’ Internet service type (http ya https)
  • prefix β†’ Usually www
  • domain β†’ Website ka naam (example.com)
  • port β†’ Server ka port number (default http ke liye 80)
  • path β†’ Server ke andar ka folder location (/blog/)
  • filename β†’ File ka naam (index.html)

Common URL Schemes

  1. http β†’ Normal web pages (not secure)
  2. https β†’ Secure web pages (encrypted)
  3. ftp β†’ Files upload/download karne ke liye
  4. file β†’ Apne computer ki file access karne ke liye

Example:


URL Encoding Kya Hota Hai?

Internet sirf ASCII character set ko directly send kar sakta hai.
Agar URL me special ya non-ASCII characters hote hain, to unhe convert karna padta hai. Is process ko URL Encoding kehte hain.

Kaise Kaam Karta Hai?

  • Special characters ko % ke saath hexadecimal value me convert kiya jata hai.
  • Space ko normally + ya %20 se replace kiya jata hai.

Example:

Agar text hai: Hello GΓΌnter, toh browser isko encode karega kyunki “ΓΌ” normal ASCII me nahi hai.

Example conversions:

  • Space β†’ %20
  • € β†’ %E2%82%AC (UTF-8 me)
  • Β£ β†’ %C2%A3

Understanding URL in HTML helps developers link web resources properly.

Related posts:

Leave a Comment