prongs
prongs

Reputation: 9606

how is absolute path of <a href="..."/> determined?

I have an html deep inside my directory structure inside c:\. one line there is this:

<link type="text/css" rel="stylesheet" href="/s/2036/21/2/_/download/superbatch/css/batch.css" media="all">

When I hover over the link, it shows file:///C:/s/2036/21/2/_/download/superbatch/css/batch.css as the link address. I want it to interpret to actual location which is file:///C:/Users/name/folder1/...some folders/s/2036/21/2/_/download/superbatch/css/batch.css

What changes are needed to make?

EDIT: there are several files containing relative links so I can't just edit each and every of them.

P.S: please change the title to something better if this one is not expressive enough.

Upvotes: 3

Views: 22652

Answers (4)

prongs
prongs

Reputation: 9606

finally I had to put the files inside a webserver's htdocs folder. I was kinda hoping for a different solution

Upvotes: 0

Royi Namir
Royi Namir

Reputation: 148644

First - I dont see any anchor in your example.

Second , it will work only in IE.

you have to access the item through UNC ---> \\myShare\lalala

here is a working example :

 <a type="text/css" rel="stylesheet" href="\\dev-8\c$\1.txt" >fsdfsd</a>

where dev-8 is the name of my computer.

create 1.txt file in your root - and it will work.

Upvotes: 0

Ja͢ck
Ja͢ck

Reputation: 173642

If your HTML file is at C:\Users\name\folder1\...some folders\, you can just remove the leading slash to make it a relative path.

Otherwise you have to prefix the address with file:///C:/Users/name/folder1/...some folders to keep it absolute.

Upvotes: 5

GodLesZ
GodLesZ

Reputation: 919

<link type="text/css" rel="stylesheet" href="./s/2036/21/2/_/download/superbatch/css/batch.css" media="all">

Note the . (dot) at the begining, which means its a relative path, starting at the current executing directory of the document/the file.

Upvotes: 0

Related Questions