SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Nov 2009
    0 Post(s)
    0 Thread(s)

    Organizing website folders

    In the past I've placed all my .html files in the same folder on my site, however I've been noticing a bunch of sites that will have a folder on the server with the title of the page. For example, instead of it will be The obvious benefit I can see is simply organizing the site a bit more but I've seen it on sites that don't contain an abundance of pages. Are there there other benefits of setting a site up like this and if so what are they? Also, what's the best practice for creating links to pages in different folders? Would it be using absolute or relative links?


  2. #2
    Visible Ninja bronze trophy
    JeffWalden's Avatar
    Join Date
    Sep 2002
    Los Angeles
    5 Post(s)
    0 Thread(s)
    What you're seeing may be either placing the files in separate directories or it may be SEO friendly URLs. Regardless of what is actually going on, it's generally not a bad idea assuming that you've executed it properly.

    SEO friendly URLs are great for visitors as seeing makes more sense than They also help search engines, to an extent. Changing your website to SEO friendly URLs isn't going to move you from ranking 150th to 3rd on a particular keyword but it can't hurt.

    SitePoint has a nice article on this:

    That being said, I still use directories (and SEO friend URLs) when I'm designing a website. I think it's just nicer to keep things organized. I generally use relative links from the document root. For instance:
    <a href="/contact/contact-us.php">Contact Us</a>

  3. #3
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    51 Post(s)
    2 Thread(s)
    however I've been noticing a bunch of sites that will have a folder on the server with the title of the page. For example, instead of it will be
    I would say, 99% of the time, they didn't really put the contact.html in its own directory.

    Usually instead, mod_rewrite (or whatever similar thing non-Apache servers use) imitate a directory setup that doesn't actually exist. What's awesome about this is, when you reorganise your site (as someday you likely will), your URLs won't suffer. So if

    /folders/uploades/foo.jpg and all the other images

    gets changed to

    /images/foo.jpg and all the other images (you decide to move them all to a real folder called "images")

    you can have image
    take the user to image

    and you didn't have to worry that visitors after the change would get a 404.

    The article linked above is doing it with PHP. If you are running Apache you can also do it with the server alone:
    (also with lighty and some other servers, not sure what you'd do with IIS)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts