1

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?

Arun Raj R
  • 2,197
  • 3
  • 13
  • 23

1 Answers1

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 use Download 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
  • @ArunRajR That looks like the person is using IIS which is a server – Pete Oct 20 '16 at 14:46
  • 1
    @ArunRajR — then it depends on which server you use – Quentin Oct 20 '16 at 16:10
  • @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