Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/426.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/278.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 上载站点文件,index.html或home.html_Javascript_Php_Html_Mysql_.htaccess - Fatal编程技术网

Javascript 上载站点文件,index.html或home.html

Javascript 上载站点文件,index.html或home.html,javascript,php,html,mysql,.htaccess,Javascript,Php,Html,Mysql,.htaccess,我正准备上传我的第一个网站,我正在研究如何做到这一点,同时我正在等待我的包升级到包含mysql数据库 快速提问-我是否需要将我的主页命名为'index.html',从而将我网站每页上的每个'home.html'链接更改为'index.html'?我也听说过“index.htm”,html和htm之间有什么区别 从我所读到的,这是一个很好的实践,甚至更好的实践应该是从一开始就这样称呼它!但您也可以更改htaccess文件中的默认页面。这是正确的吗?如果是的话,是否有负面影响 我不喜欢改变每一个主页

我正准备上传我的第一个网站,我正在研究如何做到这一点,同时我正在等待我的包升级到包含mysql数据库

快速提问-我是否需要将我的主页命名为'index.html',从而将我网站每页上的每个'home.html'链接更改为'index.html'?我也听说过“index.htm”,html和htm之间有什么区别

从我所读到的,这是一个很好的实践,甚至更好的实践应该是从一开始就这样称呼它!但您也可以更改htaccess文件中的默认页面。这是正确的吗?如果是的话,是否有负面影响

我不喜欢改变每一个主页链接,但如果它被认为是一个更好的选择,我会的


谢谢

最好将其设置为index.html,因为index.html比home.html更好


是的,您可以通过.htaccess和.html更改索引文件,而.htm没有区别,只是相同html的扩展名不同。

是的,您可以更改默认索引文件,甚至更改顺序。有些选择是:

您正在使用服务器端脚本,例如php 将其添加到.htaccess文件中

DirectoryIndex index.php index.html
b您没有使用任何服务器端SCRPT

DirectoryIndex index.html

这样,您就不必处理home.htm或index.htm等默认值,浏览器将自动打开索引文件。虽然这是真的-您可以将浏览器重定向到home.html,但将起始站点命名为index.html总是一个更好的选择

关于HTML和HTM之间的区别。。。没有

几年前,在DOS时代,扩展名只有3个字符长的“htm”。
现在,我们有了更长的扩展名,比如4个字符的“html”。

是的,您可以使用home.html,但是,您必须在web服务器中设置默认的站点首选项,以提供该扩展名,而不是默认的index.html

虽然没有区别,但使用index.html是有益的,因为它是默认的,如果您使用的是干净的URL,例如domain.com/contactus、domain.com/aboutus等,而不是domain.com/contactus/home.html和domain.com/aboutus/home.html等,它将帮助您减少web服务器配置时间

最后,在.html和.htm之间没有区别。这只是一种偏好。

.html或.htm,根本没有区别,只是偏好。尽管如此,我们学习使用.html 4个字符而不是典型的3个字符来处理包括图像png、jpg在内的所有内容还是很奇怪的。它必须有8位根。我不知道。但没有区别。