0

.htaccessURLに設定しました検索機能だけで動作するすべてを書き直し検索機能を動作させる方法を停止します

私の検索URLはこれです

http://domain.com/index.php?a=search&q=word

しかし、検索ボックスのURLを送信した後、これは機能しません

http://www.domain.com/?a=search&q=word

検索ボックスを機能させるにはどうすればよいですか?私のhtaccessファイル

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.domain.com
RewriteRule (.*) http://domain.com/$1 [R=301,L]
RewriteCond %{request_filename} -f
RewriteRule ^(.*) $1 [L]
RewriteRule ^([^/]*)$ /index.php?a=$1 [L]
RewriteRule ^([^/]*)/([^/]*)$ /index.php?a=$1&q=$2&page=$3 [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /index.php?a=$1&q=$2&page=$3 [L]

私の検索フォーム

<form class="form-wrapper cf">
<form accept-charset="UTF-8" action="http://www.domain.com/index.php" method="get">
<input name="a" type="hidden" value="search" />
        <input type="text" id="search" name="q" placeholder="Search here..." required>
        <button type="submit">Search</button>
</form> 

ありがとう

4

1 に答える 1

0

私は変化によって解決策を得ました

<form class="form-wrapper cf">
<form accept-charset="UTF-8" action="/index.php" method="get">
<input name="a" type="hidden" value="search" />
        <input type="text" id="search" name="q" placeholder="Search here..." required>
        <button type="submit">Search</button>
</form> 

への変更

<div class="form-wrapper cf" >
<form accept-charset="UTF-8" action="/index.php" method="get"><div style="margin:0;padding:0;display:inline"><input name="a" type="hidden" value="search"/></div>
<input id="search" name="q" type="text"/>
<button type="submit">Search</button>
</form>
</div>
于 2012-07-06T18:05:42.557 に答える