admin管理员组文章数量:1333201
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
4 Answers
Reset to default 5Yes 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.
本文标签: javascriptuploading site filesindexhtml or homehtmlStack Overflow
版权声明:本文标题:javascript - uploading site files, index.html or home.html - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742278637a2445677.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论