2012-04-16 19 views

回答

0

感谢您的答案球员,这对我来说,取自here

RewriteCond %{QUERY_STRING} s=(.*) 
RewriteRule ^$ /search/%1? [R,L] 
0

可能是这样的

RewriteEngine On 
RewriteRule ^search/(.*) index.php?s=$1  [QSA,L] 

这样,您将可以访问你的网站,如

http://hello.com/search/hey将被解释为http://hello.com/index.php?s=hey

希望这有助于

0

将这个代码DOCUMENT_ROOT下的.htaccess:

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

# external redirect from index.php?s=key to search/key 
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+index\.php\?s=([^\s]+) [NC] 
RewriteRule^search/%1? [L,R,NC] 

# external redirect from search/key to index.php?s=key 
RewriteRule ^search/(.+)$ index.php?s=$1 [L,NC,QSA]