Hello Guys,

In my current project, I try to make a friendly URL structure that emphasizes the structure of the website.
For example:
instead of :www.mysite/about/history.html
the URL is:www.mysite/about/history/

So in order to achieve this kind of output I put folder structure a followed:
"about/history" and put the index.html file in each of the folders and sub folders (in this case in" history" folder).

My question is: Is it a good practice? or is there a better way to achieve this?

Thanks in advance guys. I found it's difficult to find the answer ot my question on the net.


Recommended Answers

All 4 Replies

Honestly, from what I have seen and worked with for a few years now, the way that you described seemed the best way to fit what you were trying to do. There are other routes I guess that you could go about doing that (Like when I made my first website at 3:00 A.M. with no sleep for 2 days) but yours is the simplest that I have so far found.

Hi Goody11,

Thanks for your response. I've read some articles about this matter and they suggest to use some kind of server URL translation processing and permalink.

Is that what you mean by "other routes"?


Yes, but I thought personally things started to get overly complicated at that point and I didn't think that it was worth it to use a bunch of effort using the processing method. Still, if I were you, I would try to learn as much about them as you can for the sake of learning.

server processing, the google search would be for, apache mod_rewrite
too, have index.php in the folder and link to the folder
also works when you dont want the folder directly linkable
index.php/index.html/default.asp in those folders - a permanent redirect to where you do want them to go

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.