File extension question.

Discussion in 'Web Design and Development' started by definitive, May 14, 2013.

  1. macrumors 68000

    definitive

    Joined:
    Aug 4, 2008
    #1
    I usually build simple HTML sites, and in most cases every page contains the .html extension. When I made Wordpress sites, I was able to modify how these turn out so that the page name wouldn't have any extensions. Is it possible to do the same for the basic HTML sites that I build? I tried rewriting it through htaccess file before, but was unsuccessful in getting everything to work smoothly. Is it a bad idea to simply have the HTML files without the extension, or would that present a problem with some browsers? I'm mostly looking for the best practices when it comes to these things.
     
  2. macrumors newbie

    Joined:
    Jan 31, 2013
    #2
    i think removing file extensions from files (even if it's all HTML) would be considered bad practice (and even inadvisable).

    i don't think it would be an issue with the browser (client-side), but issues could come up on the server-side / on your web server.

    for example, you may have a page domainname.com/info.html but if you tell htaccess to process all files as html domainname.com/info could still point resolve to the original info.html file.

    now . . . what if you had a directory at domainname.com/info ? how would the web server resolve a link going to domainname.com/info ? Would it go to the root of the domainname.com/info folder OR try to resolve to the domainname.com/info file?
     
  3. macrumors newbie

    Joined:
    Jan 4, 2013
    #3
    re: File extension question.

    You can't remove the file extensions on WordPress based sites as the template files need to have .php extension. What you can do in WordPress is set up permalinks, but that is *not* removing the file extension.
     

Share This Page