关于URL最后斜杠/问题

由于在当前网址末尾未加斜杠/,导致a标签的href会跳转到同级目录下,而不是希望得到的下级目录。

1./Admin/crm/customer
2./Admin/crm/customer/
<a href='1/change/'></a>

末尾不加斜杠代表的是在crm下的customer文件,加上斜杠代表的是customer目录。

因此,在末尾不加斜杠时,点击a标签回去寻找customer同一级的1/change/,得到的地址是

/Admin/crm/1/change/

加了斜杠,回去寻找customer目录下的1/change/,得到的地址是

/Admin/crm/customer/1/change/

 

参考:

https://blog.csdn.net/bruce_6/article/details/82219522





posted @ 2019-03-20 22:56  守望人间  阅读(1676)  评论(0编辑  收藏  举报