html - Does using ./ in relative links work with Windows servers? -


Sorry if this is a stupid question ...

I have developed an application that The link creates the URL by adding the URL to the site root (which is hosted on the site).

For example:

  & lt; Link rel = "stylesheet" href = "& lt;? = SITE_ROOT & gt; /assets/css/global.css" & gt;  

Notice that a slash is coming after the site root. I need to be a relative link now, so I tried to use dot as the value of SITE_ROOT.

This makes it:

  & lt; Link rel = "stylesheet" href = "./ asset / css / global.css" & gt;  

As far as I can tell, it works fine. Is this a valid relative link? Or is there no reason why I should not do it like this?

Note: I am not trying to go to a directory, otherwise I will use .. / I am just trying to be in the same directory Since there is a slash after the SITROOT, I can not leave it blank or it will become a root relative link.

Update: Will it work with IIS?

This link works on the client, not on the server, and as far as I know that & Lt; A & gt; Link ./sources/css/gallery.css is the same as assets / css / global.css , which means the folder properties under the current sub-site . The ./ part is redundant if you have any links related to the server that you should start with a slash, i.e.: /assets/css/global.css stackoverflow. Com / assets / css / global will go to CSS, even when you are on a sub site.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -