Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

definitive

macrumors 68020
Original poster
Aug 4, 2008
2,050
894
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.
 

sonofjay

macrumors newbie
Jan 31, 2013
9
0
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?
 

Zyriab

macrumors newbie
Jan 4, 2013
27
9
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.