Please help me. how to remove "?" in query string url rhino/sub-categories/?category=Hotel
like as 'rhino/sub-categories/Hotel' in localhost. it's called data in custom database. So, i want to remove ?
from the url. I'm trying htaccess like as-
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /rhino/
RewriteRule ^index\.php$ - [L]
RewriteRule ^sub-categories/([^.]*)$ sub-categories/?category=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /rhino/index.php [L]
</IfModule>
and try function.php like as:-
function listen_rewrite_action() {
add_rewrite_tag('%category%','([^/]*)');
add_rewrite_rule('^sub-categories/([^/]+)$','index.php?pagename=sub-categories&category=$matches[1]','top');
add_rewrite_rule('^sub-categories/([^/]+)/page/([^/]+)$', 'index.php?pagename=sub-categories&category=$matches[1]&paged=$matches[2]','top');
}
add_action( 'init', 'listen_rewrite_action' );
syntax and many more. Please help me how to solve this.