Home > Software engineering >  How would I add URL subsections/subpages?
How would I add URL subsections/subpages?

Time:02-10

How would I add things like this:

/page/sub-section

ex: https://url.com/account/notifications

CodePudding user response:

In terms of a static site, each slash represents a single directory on your web server.

/page/sub-section

Would mean you have the

  • / the root directory
  • /page a folder called page
  • /sub-section another folder called sub-section

In the last folder, you would then have your index file, which will be loaded once visiting the URL. For example index.html.


In terms of web development this is named routing and all the big web frameworks come with own modules for routing. Here you don't have to create directories as described above, instead these frameworks will handle the request and route it internally to find the right content and display it for that route.

  •  Tags:  
  • Related