RewriteRule不喜欢多个单词

Ok I have a problem using $_GET with htaccess. If I search for "post title" i go to http://site.com/search/post%20title and this line:

RewriteRule ^search/([a-zA-Z0-9_-]+) search.php?post_title=$1

Would create that $_GET but it only does so for the first word if I:

echo $_GET['post_title'];

I only get the first word how would I fix this?

Thanks in advance!

RewriteRule ^search/([a-zA-Z0-9_-\s]+) search.php?post_title=$1

This defines a space as \s

Add a space to your character class:

RewriteRule ^search/([a-zA-Z0-9 _-]+) search.php?post_title=$1