This site is really a internet search engine.

During my .htaccess file I've:

RewriteRule ^news/(.*)\.html$ /results/news.php?name=$1

And my link structure is /news/what-is-up.html using hyphens.

After I look for /results/news.php?title=hello world I recieve spun sentences than after i use /news/hello-world.html

It appears the search is trying to find hello-world using hypens rather than spaces, I possibly could easily solve it utilizing a + sign but I wish to use hyphens. Does anybody understand how to get it done?

This is actually the code I personally use for transforming the title variable into URL friendly:

function toAscii($str, $replace=array(), $delimiter='-') {
if( !empty($replace) ) {
    $str = str_replace((array)$replace, ' ', $str);
}

$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $str);
$clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean);
$clean = strtolower(trim($clean, '-'));
$clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);

return $clean;
}

and my internet search engine uses http location such as this:

if ($q != '') {
   header( 'Location: http://'.$_SERVER['SERVER_NAME'].'/news/'.toAscii($q).'.html' );
   die();
}
else
{
    header('Location:http://'.$_SERVER['SERVER_NAME'].'/news/');
    die();
}

Thanks

Basically have understood you properly use str_replace to exchange a hyphen having a space before posting it for your search.

$search_term = str_replace("-", " ", $incoming);

You have to handle word splitting in your finish becasue it is being rewritten.

You skill is have

RewriteRule ^news/(.*).html$ /results/news.php?title=$1&lifierrewrite=true

and when $_GET['rewrite'] exists, you need to do str_replace("-", " ", $incoming)