Relative URLs : examples

Directory hierarchy

What you want

Relative URL

Root

  • Directory A

    • file1.html

  • Directory B

    • Directory B1

      • file3.html

    • Directory B2

      • file2.html

         

Go from file2 to file3

../B1/file3.html

../../B/B1/file3.html

/B/B1/file3.html

Go from file3 (or file2) to file1

../../A/file1.html

/../A/file1.html