This question already has answers here:
Linking a UNC / Network drive on an html page
(3 answers)
Closed 6 years ago.
I need to open filelink (network share in local) in the browser.
I use such code:
<a href="http://file://///server/localfolder">
It open link in the browser but convert it to such format:
file/////server/localfolder (remove colon).
This way browser don't open local folder.
I have tried to change file:///// to file:// or file:/// or file://// . But colon stell removed by browser.
How to solve it?
You can't specify more than one protocol definition as part of a URL schema. You shouldn't link to file:// either, really, but if you absolutely must, just remove the http:// definition as follows:
<a href="file:///server/localfolder">
You can read more about file: protocol, and in particular its implementation in the following links:
Wikipedia Article
Another SO question (with very good answer)
Related
This question already has answers here:
How can I create a link to a local file on a locally-run web page?
(5 answers)
Closed 2 years ago.
I'm trying to open a file on my local disk c: throught a link on my personal web page.
using this:
open locally
on the new "_blank" page, the url bar appears like "file///C:/myfolder/myfile.pdf", the colon (:) was removed from "file:///". The local file doesn't open just because the colon is missed.
What am I doing wrong? How can i fix it?
Try structuring your link like this
Open Locally
You do not need to add the blank window conditional as it will open with what ever your default PDF viewer is.
Remove "http://"
open locally
Local file protocol is "file://"
This question already has answers here:
How to specify a local file within html using the file: scheme?
(5 answers)
Closed 3 years ago.
I try to put a link to a file in my page, such that, once a user clicks the link - the browser downloads the file.
HTML:
<a href="correct_path...." download>downloadable link</a>
Here is the image shows the full path of the link:
And here is the image shows the file does exist:
So why, when I click the link NOTHING happens? it doesn't download..
When you work with a server (local server too) the root of the urls/links must be the server, not your computer.
For example, in your case, if the root folder of your server is 'SMIS' the correct URL will be "http://localhost/SMIS/Files/6.pdf"
This question already has answers here:
How can I create a link to a local file on a locally-run web page?
(5 answers)
Closed 6 years ago.
I'm following online tutorials to start learning HTML and I'm having trouble adding an image. What I'm doing is just typing into a txt (renamed as .html and with UTF-8 encoding, per the tutorial's instructions) document, then checking to see the code changes work properly by opening. However I cant seem to get the image to load properly when testing it, no matter what I do. Here is what I have in the text document:
<img src="C:\users\jason\desktop\website\curved.jpg">
I double checked that the path is correct, everything is spelled correctly, and that image is in the same folder as the html document. So what am I doing wrong here?
Try using the file:/// protocol if you want to link to local files.
<img src="file:///C:\users\jason\desktop\website\curved.jpg">
Just double check that it is in fact a .jpg and not a .png for example, and try the following:
<img src="curved.jpg">
I would also have the image saved in the same folder as the HTML file.
This question already has answers here:
Replace www.example.com w/ www.example.com
(4 answers)
Closed 6 years ago.
Example:
Click here to go to www.example.com!
and
Click here to go to www.example.com!
The first one redirects to the following URL: http://www.currentsite.com/www.example.com
while the second one works perfectly fine.
here's the code I'm using: (ruby on rails)
<%=h link_to #user.details.website, #user.details.website, :class => 'link'%>
The only solution I have would be checking for http:// and add it if it's not already there.
Why, yes. URIs not starting with / or ...:// are relative URIs and are resolved against the current URI. Your browser has no idea that you mean "www.example.com" to be a domain name, because it's also a perfectly valid path name and looks like a relative URI.
You have three choices:
start from the protocol (http://example.com) to link to different protocols and/or domains
start with a / to link to a different absolute path within the current domain
link to relative paths from the current path within the current domain
I'm not sure what exactly your question is but:
You need to include http:// in your href link unless you are linking to a file on your server.
This question already has answers here:
How to get user friendly URLs without any file extensions? [closed]
(3 answers)
Closed 6 years ago.
My website http://www.dorsetdesigns.co.uk/
doesn't have .html after it but when i go to "about us page" it has .html on the end?
By default a web server will display the index.html or index.aspx, or default.aspx page in a folder.
Use Mod_rewrite to make urls appear anyway you want.
http://httpd.apache.org/docs/current/mod/mod_rewrite.html
I believe adding the following rule to mod_rewrite would remove all .html from urls
RewriteRule ([^.]+)\.html /$1
A very simplified explanation:
Well, back when the web started a few decades ago, servers only "served" static HTML files. That meant you had to add .html to all requests you made.
Now we have dynamic content, it changes in real time and file extensions are obsolete.
More on topic to your question, it has to do with what kind of server you are using, how it is configured and how old it is. The extensions (not only html, but also php and aspx to name a few) are now optional.
This is done simply by default documents. If you have default document named like index.html or default.html then anytime you access the root directory (at any level) you will see like that. In the URL example you gave it is same as accessing http://www.dorsetdesigns.co.uk/index.html and they have default document as index.html.
URL rewriting is not needed for simple stuff like this.