Rajjat Bayas Rajjat Bayas - 11 months ago 56
HTML Question

How to make the URL shorter using Javascript/JQuery?

I am trying to make the my URL shorter to access my HTML pages from different folders.

My folder structure is:

My Project

When I am trying to access the files from HTML folder, I need to write complete URL in browser.

eg. http:// Coder:8055/Files/HTML/Login.html

but, I want to use URL: http:// Coder:8055/Login.html

with same folder structure. This is same problem with showing other HTML files to access from the folder structure.

I want to keep same folder structure and show shorter URL in browser.

How do I create this type of URL to access my all HTML files...?

Answer Source

This worked

history.pushState('', '', '/login.html');