Rewrite wordpress search url

le-bouzin

Newbie
Joined
Feb 15, 2010
Messages
8
Reaction score
0
Hi there,I'm lookin for a php function or htaccess rewriting for wordpress earch query.This query is built this ways : domain/?s=queryterms1+queryterms2 and can contains upper and lower case, and digits and any special character. I need this query to be rewritten into domain/search/queryterms1+queryterms2.html
 
.htaccess should look something like this
Code:
RewriteEngine On
RewriteRule ^/search/([\w\d\+]+).html$ index.php?s=$1 [L]
 
thanks for your reply.

Actually I use rewriting options si index.php is already rewrited and your code do not work.

Here is my current htacces :

PHP:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
/IfModule>

# END WordPress


I tried to use this rule with no luck :
RewriteRule ^/search/([\w\d\+]+).html$ /?s=$1 [L]
 
Thnaks you Andey, was what I looking for !
 
Back
Top