Rewrite url using htaccess with parameter
My original url is test.com/a/b/index.php/index/sub?query1=1&query2=2.
I want to rewrite it to: test.com/a/b/cate/1/2.
I am using htaccess with these lines:
RewriteEngine on
RewriteBase /a/b
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^cate/([0-9]+)/([0-9]+)$ index.php/index/sub?query1=$1&query2=$2 [L,QSA,NC]
This does not work. I do not know why. Can anyone please help?
Edit: I am using CodeIgniter.
+3
source to share