在meta标记中,带斜杠的url与不带斜杠的url [英] in meta tag, url with slash vs url without slash

查看:103
本文介绍了在meta标记中,带斜杠的url与不带斜杠的url的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

两者之间有什么区别

<meta http-equiv="refresh" content="0; url=/file.html" />

<meta http-equiv="refresh" content="0; url=file.html" />

我从domain.com/folder/index.html调用此方法.第一个重定向到domain.com/file.html,另一个重定向到domain.com/folder/file.html.为什么?

I am calling this from domain.com/folder/index.html The first one would redirect to the domain.com/file.html and the other one to domain.com/folder/file.html. Why?

推荐答案

当您使用"/"作为路由的第一个字符时,表示该路由从根(domain.com/)开始.如果您不使用它,则路由将从当前位置(domain.com/folder/)开始.

When you use "/" as the first character of the route you mean that the route starts from the root (domain.com/). If you don't use it, the route starts from the current location (domain.com/folder/).

这篇关于在meta标记中,带斜杠的url与不带斜杠的url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆