.htaccess Url重写停止我的搜索功能

.htaccess Url重写停止我的搜索功能,.htaccess,mod-rewrite,rewrite,.htaccess,Mod Rewrite,Rewrite,我已经设置了.htaccess 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 Re

我已经设置了.htaccess 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> 

谢谢

我通过改变找到了解决方案

<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>

如果您正在将www.domain.com的所有请求重定向到domain.com,为什么您的搜索表单会执行此操作http://www.domain.com/index.php? 为什么不删除www以避免重定向?我已经设置了表单的action/index.php,并且在没有www的情况下也进行了测试,但没有工作