OK, I want to change the default domain.com/search/keyword to maybe domain.com/result/keyword.
I can get the "search" based one to work by adding RewriteRule ^search/(.+)?$ /index.php?s=$1 [QSA,L] to my .htaccess file.
Firstly I tried just changing the .htaccess file to RewriteRule ^result/(.+)?$ /index.php?s=$1 [QSA,L] to use the "result" but this was not enough.
I also have to go to ../wp-includes/rewrite.php and change the following:
/**
* Search permalink base ( example.com/search/query ).
*
* @since 1.5.0
* @access private
* @var string
*/
var $search_base = 'search';
to
/**
* Search permalink base ( example.com/search/query ).
*
* @since 1.5.0
* @access private
* @var string
*/
var $search_base = 'result';
Go and save my permalinks again and now I can search using domain.com/result/keyword
The issue I have is that this has been a change to the core files, I need to do this hopefully with a hook so the core code remains unchanged as a wordpress upgrade would over write these changes.
Also is there a way to change the space in the search terms from domain.com/result/keyword1+keywords2 which uses a + to say domain.com/result/keyword1-keywords2 which uses a more seo friendly -
Can anyone please help me out with this.
Thanks
Stephen.