关于#vscode#的问题:并且用的是wampserve,使用php连接数据库

就是我写了一个网站,并且用的是wampserve,使用php连接数据库。

默认打开

img


手动修改后

img

我的需求是怎样直接默认打开就是localhost/.

可以在register.html里面加上js判断,但是当部署到正式的生产环境时需要注意注释掉或者加上域名,不然访问的时候会强制跳转到localhost导致访问异常:


<script>
// 如果不是localhost或者127.0.0.1或者你的域名访问,则强制跳转到localhost或者你的域名下
if (window.location.href.indexOf('localhost') == -1 || window.location.href.indexOf('127.0.0.1') == -1) {
    location.href = "http://localhost/MYWEBSITE/register.html"
}
</script>

默认打开是什么地址?