2013-08-16 305 views

回答

0

在Web根/目錄添加到您的.htaccess

RewriteEngine on 
RewriteBase/

RewriteCond %{QUERY_STRING} !^$ 
RewriteRule ^$ http://%{HTTP_HOST}/ [R=301,L] 
0

啓用mod_rewrite和.htaccess通過httpd.conf然後把這段代碼放在你的.htaccessDOCUMENT_ROOT目錄下:

Options +FollowSymLinks -MultiViews 
# Turn mod_rewrite on 
RewriteEngine On 
RewriteBase/

RewriteCond %{QUERY_STRING} ^q=.+ [NC] 
RewriteRule ^$ /? [R=301,L]