链接到当前页面而没有查询字符串 [英] Link to current page without query string

查看:68
本文介绍了链接到当前页面而没有查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道做链接有很多技巧,例如<a href="?query=string">将在附加查询字符串后链接到当前页面.在删除查询字符串后,不用输入文件名就可以链接回当前页面吗?

I know there are a lot of tricks for doing links, for example <a href="?query=string"> will link to the current page after appending the query string. Is there a way to link back to the current page, after removing the query string without just typing the file name?

例如,在页面foo.php?q=3上,我想链接到foo.php.有快捷方式可以做到这一点吗?该文件将被重命名几次,所以我不想键入一堆链接,然后在以后进行编辑.

Example, at the page foo.php?q=3, I want to link to foo.php. Is there a shortcut-type way to do this? The file will be renamed several times, so I don't want to type a bunch of links and then have to edit them later.

即使这些是PHP文件,我仍在尝试避免针对此特定问题的服务器端解决方案.

Even though these are PHP files, I'm trying to avoid a server-side solution for this particular problem.

推荐答案

href="?"

不是确切地,您所追求的是-末尾仍然有一个问号-但在功能上是等效的.

Not exactly what you are after - there's still a question mark at the end - but functionally equivalent.

这篇关于链接到当前页面而没有查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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