Php 当我在htaccess中输入代码时,我的网站进入404页面?

Php 当我在htaccess中输入代码时,我的网站进入404页面?,php,.htaccess,url,url-rewriting,Php,.htaccess,Url,Url Rewriting,我需要这个 www.mydomain.com/applewww.mydomain.com/banana www.mydomain.com/mango至 www.mydomain.com/search.php?q=apple www.mydomain.com/search.php?q=banana www.mydomain.com/search.php?q=mango 这不起作用 我的网站进入404页 我的.htaccess 选项+后续符号链接在 重写规则^(.*)search.php?q=$1

我需要这个

www.mydomain.com/apple
www.mydomain.com/banana
www.mydomain.com/mango

www.mydomain.com/search.php?q=apple
www.mydomain.com/search.php?q=banana
www.mydomain.com/search.php?q=mango

这不起作用
我的网站进入404页
我的.htaccess

选项+后续符号链接

重写规则^(.*)search.php?q=$1


如果您想要这样的url参数,您可能正在PHP中寻找$\u GET。虽然这段代码可能会回答这个问题,但最好解释一下它的功能并添加一些引用。
Options +FollowSymLinks
RewriteEngine on
#If the request is not for an existent directory
RewriteCond %{REQUEST_FILENAME} !-d
#And file
RewriteCond %{REQUEST_FILENAME} !-f
#Then rewrite the request 
RewriteRule ^(.*)$ /search.php?q=$1