-1

What is the difference between:

<meta http-equiv="refresh" content="0; url=/file.html" />

and

<meta http-equiv="refresh" content="0; url=file.html" />

I am calling this from domain.com/folder/index.html The first one would redirect to the domain.com/file.html and the other one to domain.com/folder/file.html. Why?

Naguib Ihab
  • 4,259
  • 7
  • 44
  • 80

2 Answers2

0

When you use "/" as the first character of the route you mean that the route starts from the root (domain.com/). If you don't use it, the route starts from the current location (domain.com/folder/).

mplungjan
  • 169,008
  • 28
  • 173
  • 236
Alfonso Jiménez
  • 1,235
  • 1
  • 13
  • 24
0

Using / indicates that the path begins in the root folder. This is called an absolute path.

If you avoid the slash you are using a relative path, so the path begins in the current folder.

kosmos
  • 4,253
  • 1
  • 18
  • 36