I need to create a single-page website using HTML5, which is similar to
http://www.20thingsilearned.com
It uses “Sections” in HTML5 as shown below:
http://www.20thingsilearned.com/en-US/web-apps/1
When I create a page index.html with the sections named: foreword, credits, etc …
I can access the page by: http://localhost:2325/index.html
and the sections by:
http://localhost:2325/index.html/foreword, unlike the above shown website!!
can you please suggest a solution?
further clarification:
Is it possible to do this via JS??
By definition/convention, you can access your page with http://localhost:2325/
If a file isn’t specified (which is explicit with the trailing slash), the server provides by default the index.html file.
This default can be changed with the server’s settings, I think.
I might have misunderstood the last part, but in general, one accesses the sections with the http://localhost:2325/#forword syntax, instead. The # says to jump to the named section.
Stuff like web-apps/1 is generally handled by a server-side script (PHP, ASP or other) along with rewrite rules, redirecting such URL to a script serving the correct content.