Modify WordPress search result URL using .htaccess file

I’m currently experimenting with a WordPress website that uses a modified search.php file to show dynamic web pages.

When a search term is entered it produces a URL similar to:

example.com/?s=search+term

Is it possible to add a rule(s) to my .htaccess file that changes the result URL into something more friendly without effecting the search.php function? Eg:

example.com/search-term

or, even better:

example.com/BLOG NAME/search-term.html

Answer

I don’t think you can achieve this without .html or any other trick, because by default WP uses clean URLs for posts, so you can’t mess the functionality, but you can do something like this:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog_name/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ([^/]+).html$ ./?s=$1 [L]
</IfModule>