I have a simple search form with a box and a button.
<form action = "/search/" method = "get">
<input id = "search_box" type ="text" name = "location" value placeholder = "Where are you?" />
<input id = "search_button" type="submit" value = 'Go' />
</form>
This sends me to /search/?location=whatever
How do I get this to send me to /search/whatever instead? – i.e. no GET data, just an URL.
You cannot rewrite the form post methods like that. A way to do this efficiently is through a
.htaccessat the root.This changes
/search/?location=whateverto/search/whateverOr, If you are looking for a complicated JS solution. Here is one using jQuery
Demo