Is there any way to remove the .html from a URL? I haven't host the site yet. Existing URL is "file:///E:/SampleWorks/Download.html" and I would like to change it to "file:///E:/SampleWorks/Download". How can I do this?
Asked
Active
Viewed 231 times
1
-
First thins first a server – MatejMecka Oct 20 '16 at 14:19
-
@MisterPositive — It is a `file:` scheme URL, they aren't using a web server. – Quentin Oct 20 '16 at 14:23
-
you are opening the file locally, if you don't want the .html extension, rename your file to "Download" – Dali Oct 20 '16 at 14:31
1 Answers
1
No.
Changing URLs so they don't map directly on to the file system is the province of an HTTP server (which you aren't using).
The only other means to play around with what is displayed in the address bar is the history API but:
- The browser wouldn't find
Download.html
if it had been told to useDownload
and the user hit refresh - Security restrictions on documents loaded over
file:
scheme URIs generally prevent the history API from working

Quentin
- 914,110
- 126
- 1,211
- 1,335
-
Ok, but what if i host it locally or something like this http://localhost:3020/SampleWorks/Download – Arun Raj R Oct 20 '16 at 14:35
-
-
1
-
@Pete : yes i host it locally(in IIS) , so now how can i remove the html extension from my url ? (i mean this ' localhost:3020/SampleWorks/Download.html ' to this ' localhost:3020/SampleWorks/Download ') – Arun Raj R Oct 23 '16 at 08:35