NOTE: I am assuming that in http://localhost/main20/ will have index.php if not then create one. It will look a like something http://localhost/main20/index.php.
Now your .htaccess
file would be something.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php/$1 [NC,L]
Options All -Indexes
In your index.php
<?php
define('WEBROOT','http://localhost/main20/');
//assuming your url is "http://localhost/main20/hello-wolrd"
$link=$_SERVER['REQUEST_URI'];
$linkArr=explode("/",str_replace(WEBROOT,"","http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']));
/*
print_r($linkArr);
will output
Array ( [0] => hello-wolrd )
*/
//now chech if $linkArr[0] is empty or not
if(!empty($linkArr[0]))
{
include("pages/view.php?id".$linkArr[0]);
}
?>
Hope this help you.
This is a good link for more information.