Print Reseller Scheme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

html, htm or xhtml?

Discussion in 'Website Design Forum:' started by Xenonsoft, May 19, 2009.

  1. Xenonsoft

    Xenonsoft Active Member

    What's the best file type to go with? Does it make much of a difference?

    We tend to go for .htm, just as a habit really.

    I'm interested to know whether there is benefits to different types or which is the best to go for.
     
  2. I generally go for html.. but thats just me :)
     
  3. Levi

    Levi Moderator Staff Member

    normally html here too

    Don't really see any difference to using htm to html myself, I rarely look at the address bar once is typed in or clicked on. Although I would probably write .html if I was typing out an address without checking it first
     
  4. tbwcf

    tbwcf Active Member

    I think some servers dont like done of the types (htm) I think can't remember any more than that I'm afraid.... go with .html
     
  5. Harry

    Harry Senior Member

    Use the XHTML Strict DOCTYPE and code with .php extensions. Make all files .index.php too. I can explain why if you like?
     
  6. MattHill

    MattHill Junior Member

    Are you asking what extension to give your filenames, or whether to use HTML instead of XHTML?

    Extensions don't matter really. Assuming your server is configured for it, you could put "Filename.wibble" if you like :)
     
  7. Xenonsoft

    Xenonsoft Active Member

    Filename Matt.

    Interesting Harry, as you offered, feel free to explain..
     
  8. Harry

    Harry Senior Member

    Well if you use PHP you can use includes (which you should be doing anyway). If not PHP then any other server side language really.

    Calling them index.php and linking to site.com/about/ rather than site.com/about.php means that a) users don't have to know/understand any of your extensions and b) if site.com/about/index.php becomes site/about/index.html for whatever reason the link to site.com/about/ will still always work.
     
  9. MattHill

    MattHill Junior Member

    I haven't built a site that's just HTML for a long time, so I have no strong feelings on the matter. It's really nothing more than personal preference at the end of the day.

    I agree with Harry that if you're doing a site that has repeated elements on every page, then it makes sense to break them apart and use includes for the common elements, using a server side language such as PHP. The folder setup for URLs (http://www.site.com/about/) is also a great solution since it's prettier and easier to remember (and can possibleyhelp with SEO too.)
     
  10. Xenonsoft

    Xenonsoft Active Member

    I find managing sites with lots of index.php's more difficult but it seems the best way to do it, I better take the plunge then.
     
  11. MattHill

    MattHill Junior Member

    I think it's OK if you only have a few pages/sub pages, but more than about ten and I agree this would probably become unmanageable. At that point you should probably switch to a CMS driven site anyway.
     
  12. Harry

    Harry Senior Member

    Or I'm sure you could mod rewrite it…? Best to ask Jazajay though—he seems to know .htaccess etc quite well.
     
  13. mike_watts

    mike_watts Member

    yep with mod rewrite you could have boobies.php and rewrite it so it appears as a directory in the browser ie www.ilove.com/boobies/ this is called a friendly url. This way you dont have to have millions of directories and index.php pages.

    Just found the code to use in .htaccess:

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteRule ^(.*)/$ $1.php
     

Share This Page