I am trying hard to rewrite this URL
http://localhost/sitecms/?search=viewPage&pageId=1
TO
http://localhost/sitecms/pages/page/1
N.B. Variable 'search' declared at the top inside index.php, viewPage as function declared inside index.php receives pageId variable, and pass to viewPage.php inside another folder(template) along with associated data.
Below is my .htaccess code.
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^pages/([^/]+)/?$ ?search=viewPage&pageId=$1 [L]
It's not working.
Suggestions are highly welcome about what I missed.