Page 1 of 1

mod_rewrite and replacing characters

Posted: Sat Nov 19, 2005 4:42 pm
by visionmaster
Hi,

I have following rule:

Code: Select all

RewriteEngine On
RewriteRule ^suchmaschine/(.*)\.html
/modules/mod_search.php?action=startSearch&suche[searchstring]=$1&suche[results]=10&suche[bundesland]=18&modus=all
This does following mapping:

suchmaschine/steel.html
=> /modules/mod_search.php?action=startSearch&suche[searchstring]=steel&suche[results]=10&suche[bundesland]=18&modus=all

I would like to extend my RegExp to replace underscore _ to %20 (space) like this:

suchmaschine/steel_case.html
=> /modules/mod_search.php?action=startSearch&suche[searchstring]=steel%20case&suche[results]=10&suche[bundesland]=18&modus=all

How to?

Thanks,
visionmaster