Apache服务器需要.htaccess帮助

我寻找我的url的redirect代码:

我想要的是当我的网站中有一个search应该redirect

例如:如果有人在mysite上searchgoogle.com

那么在地址栏中应该看起来像www.mydomain.com/google.com

可以在$ _POST方法或$ _GET中

我怎么做??

RewriteEngine On RewriteCond %{HTTP_REFERER} google\.com RewriteRule ^.*$ http://www.mydomain.com/google.com [R,L] 

.htaccess文件可能工作,我还没有testing过。

你可以尝试:

 RewriteCond %{THE_REQUEST} ^[AZ]+\ /(.*)\/search\.php\?q=(www\.)?([^/\ ]+)[^\ ]*\ HTTP/ RewriteRule ^.*$ http://www.mydomain.com/%1 [R,L] 

这个链接也有一些其他的例子'聪明' .htaccess规则: http : //www.askapache.com/htaccess/http-https-rewriterule-redirect.html