Answer the question
In order to leave comments, you need to log in
Site search. Where is the error in htaccess?
Good day.
Can someone please tell me how to solve the problem?
I am writing a simple site search.
On the page form and input:
<form action="/search/" class="form">
<input type="text" placeholder="поиск" name="searchword" method="$_GET">
</form>
Answer the question
In order to leave comments, you need to log in
one)
<input type="text" placeholder="поиск" name="searchword" method="$_GET">
The correct spelling is method="GET" RewriteRule ^search/([A-Za-z0-9-]+)$ /search.php?page=$1&searchword=$2 [L]
RewriteRule ^search/([A-Za-z0-9-]+)/?$ /search.php?page=$1 [QSA,L]
if you write these two lines in htaccess:
RewriteRule ^search/? /search.php?%{QUERY_STRING} [L]
RewriteRule ^search/([A-Za-z0-9-]+)/?$ /search.php?page=$1&searchword=$2 [QSA,L]
then the "searchword" parameter is passed without problems, but the "page" parameter cannot be passed. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question