We've been working on a web application and we've just about got it finished up, but there's one thing that bothering us (although by no means is it going to stop production.)
When we call one of the pages (index.html), we sometimes have to pass it a variable in the URL (searchid). So we get a page like http://domain.com/index.html?searchid=string
.
We'd ideally like to not show the ?searchid=string
, but I'm not sure how we'd do that.
My group doesn't own the index.html page (but we are working with the group that does), so I don't know how much we'd be able to do with anything like .htaccess
or similar.
I was thinking about POST
ing the variable, but I don't know how to receive it with just HTML and jQuery. Another person in my group thought that after the page loaded we could remove it from the URL, but I assume we would need a page refresh which would then lose the data anyway.
I'm trying to avoid XY problem where the problem is X and I ask about Y, so what's the right way to remove the variable from the URL?
.htaccess
would allow you to prettify the url, that can be turned into something likehttp://domain.com/searchfor/string
. Would that be enough? If you're looking to get rid ofstring
altogether, I don't think it's possible without POSTing. And you can't read POST data from html/js, only from the server end. – Gyromagnetic