Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Link to current page without query string

Tags:

html

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?

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.

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

like image 598
Alex S Avatar asked Oct 02 '09 00:10

Alex S


People also ask

Does URL include query string?

A query string is a part of a uniform resource locator (URL) that assigns values to specified parameters.


1 Answers

href="?" 

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

like image 132
Alex Barrett Avatar answered Sep 23 '22 10:09

Alex Barrett