0
I’m making my website url friendly, however, I’m having trouble capturing the form search field with .htaccess. All my attempts give 404 error.
Form:
<form action="busca" method="post">
<input type="text" name="busca" required="required" class="buscar-frm">
</form>
htaccess
RewriteRule ^busca/([0-9]+)/?$ /imv.php?busca=$1 [NC]
It was tried to use both the method
post as the get. In the search field, it is only to search by property code.
When I enter the search field, it goes to page with error 404, and not to imv.php
Check the Apache logs for what you’re getting. When you use the GET method to submit the form, the value will appear in the URL being something like "search? search={value}" (the field will be listed, hence you should consider it when searching).
– Giovanni Nunes
@Giovanninunes Still giving error 404, does not go to the page imv.php either using post or get
– Gladison
Please if I helped you, mark it as the best answer.
– Marcus Pereira