Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.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
Html 子页面名称如何更改_Html_Web - Fatal编程技术网

Html 子页面名称如何更改

Html 子页面名称如何更改,html,web,Html,Web,我想问你们,如何更改子页面的名称?比如,当我创建网站时,第一个页面是index.html(当我在任务栏中写下它并进入这个网站时,它会显示www.example),下一个页面是gallery.html,但当我去gallery时,它会显示www.example/gallery.html,我想像这个www.example/gallery一样,而不带.html,甚至www.example/g。谢谢你帮助我 使用此.htaccess代码。将www.myweb.com/test.php重写为www.mywe

我想问你们,如何更改子页面的名称?比如,当我创建网站时,第一个页面是index.html(当我在任务栏中写下它并进入这个网站时,它会显示www.example),下一个页面是gallery.html,但当我去gallery时,它会显示www.example/gallery.html,我想像这个www.example/gallery一样,而不带.html,甚至www.example/g。谢谢你帮助我

使用此
.htaccess
代码。将
www.myweb.com/test.php
重写为
www.myweb.com/test

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^.*$ $0.php [L]

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.+)\.php$ $1 [L,R=301,NE]

嗯,这取决于很多时间。您是在本地托管还是在服务器上托管?是的,我在服务器上有now@Mikik干得好!谢谢我不知道在哪里可以找到它!感谢您的帮助,如果您可以将
test.html
重写为
/test
。将我的代码中的所有
.php
编辑为
.html
。如果我帮忙,请接受我的回答:)好的。几分钟后就可以了