php - A way to not show 2 of 3 parameters in a url using .htaccess
I have the following in my .htaccess file:
RewriteCond %{THE_REQUEST} \s/+Category\.php\?pageNum_RS_Search=([^\s&]+)&totalRows_RS_Search=([^\s&]+)&Category=([^\s&]+) [NC]
RewriteRule ^ /Compare/%3/%2/%1? [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^Compare/([^/]+)/([^/]+)/([^/]+)/?$ /Category.php?pageNum_RS_Search=$3&totalRows_RS_Search=$2&Category=$1 [L,QSA]
I have tried the following:
RewriteRule ^Compare/([^/]+)/?$ /Category.php?pageNum_RS_Search=$3&totalRows_RS_Search=$2&Category=$1 [L,QSA]
This gave me the dreaded 404 error page not found, also tried to remove the%2/%1
that would not work at all as it still needs the values.
What i'm after is my page o look as follows:
mysite.co.uk/Category name/
(not show the last 2 paramaters but still use them to trigger the right page). Is this possible using .htaccess?