I am sure this should be possible but when I look at google, all it tells me is how to get the filename and stuff, I don’t want this.
I am looking for this because I use Weebly as my webhost and it only allows for .html files – when you click “Home” you are brought to /index.html and when you open the site there isn’t a /index.html.
What would be a plus is if I can add (using an if statement of course) JS that redirects if the site’s url == http://kingdomofmuqtasid.weebly.com/index.html and points the body to: http://kingdomofmuqtasid.weebly.com.
PS: can the code be placed inside the body?
is the full URL of the current page. See the MDN doc page for
window.locationfor more info.You could put this code in the
<head>section or<body>section of your page to do the redirection.P.S. This code goes in whatever page is served up when the viewer goes to “http://kingdomofmuqtasid.weebly.com/index.html”.