最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - uploading site files, index.html or home.html - Stack Overflow

programmeradmin4浏览0评论

just about to upload my first site and have just been doing some research into how to do this whilst I await my package to be upgraded to include mysql databases.

Quick question - do I need to name my homepage 'index.html'?, and therefore change every 'home.html' link on every page of my site to 'index.html'? I've also heard 'index.htm', what is the difference between html and htm?

From what I have read, this is good practice (well, even better practice would have been to call it that from the start!) but also that you can change the default page in the htaccess file. Is this correct, and if so, is there a downside?

I am not relishing the task of changing every homepage link, but if it is considered a better option, I will.

Thanks

just about to upload my first site and have just been doing some research into how to do this whilst I await my package to be upgraded to include mysql databases.

Quick question - do I need to name my homepage 'index.html'?, and therefore change every 'home.html' link on every page of my site to 'index.html'? I've also heard 'index.htm', what is the difference between html and htm?

From what I have read, this is good practice (well, even better practice would have been to call it that from the start!) but also that you can change the default page in the htaccess file. Is this correct, and if so, is there a downside?

I am not relishing the task of changing every homepage link, but if it is considered a better option, I will.

Thanks

Share Improve this question asked Feb 27, 2014 at 14:08 DJCDJC 1,1731 gold badge15 silver badges46 bronze badges 1
  • .html or .htm, no difference at all, just preference. Still, it is weird we learn to use .html (4 chars) instead of the typical 3 chars for everything including images (png,jpg). It must have 8-bit roots. Beats me. But no difference. – user1299518 Commented Feb 27, 2014 at 14:13
Add a ment  | 

4 Answers 4

Reset to default 5

Yes you can change the default index file and even the ordering. Some options are:

a) You are using server side scripting - php for example Add this into a .htaccess file

DirectoryIndex index.php index.html

b) You are not using any server side scrpting

DirectoryIndex index.html

This way you do not have to deal with default values such as home.htm or index.htm

Browser will automatically open the "index" file. Though its true - you can redirect the browser to your home.html but it is always a better option to name your start-site index.html

about the difference between HTML and HTM... There is none.

Years ago, in DOS times, extensions were only 3 characters long 'htm'. Now, we got longer extensions, like 'html' with 4 characters.

It's preferred to make it as index.html as index.html is a better practise than home.html.

Yes, you can change the index file via .htaccess and .html and .htm has no difference, it's just different extensions for the same HTML.

Yes you can have home.html, however, you will have to set your default site preferences in your web server to serve that instead of the default "index.html".

Whilst there is no difference it would be beneficial to have index.html, as it is the default and it will help you reduce web server config time if you are using clean-urls e.g. domain./contactus, domain./aboutus, etc instead of domain./contactus/home.html and domain./aboutus/home.html, etc.

Lastly, there is no difference between .html and .htm it is just a preference thing.

发布评论

评论列表(0)

  1. 暂无评论