I have the following code:
RewriteEngine On
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^category/(.*)$ searchPage.php?crs_category=$1 [NC,QSA]
RewriteRule ^ index.php [QSA,L]
index.php
index.php
category/business
searchPage.php?crs_category=business
index.php
category/:name
category/NAME
index.php
searchPage.php?crs_category=business
You can use RewriteCond to apply some conditions to the following rules. In your case, something like:
RewriteRule ^category/(.*)$ searchPage.php?crs_category=$1 [L,NC,QSA]
RewriteCond %{REQUEST_URI} !^/searchPage.php
RewriteRule ^ index.php [QSA,L]
I added the "L" switch on the first match, so it will not continue parsing rewrite rules for current request.
On the next request, the RewriteCond line says "only apply the following rule if the URI does NOT start with searchPage.php".