1
I am trying to redirect this url:
https://www.example.com/?category=1&page=1
to this url:
https://www.example.com/?category=1
I have 12 categories, can i redirect all with one code? for example i have
https://www.example.com/?category=2&page=1 => https://www.example.com/?category=2
https://www.example.com/?category=3&page=1 => https://www.example.com/?category=3
.
.
.
my code doesn't work:
RewriteEngine On
# RewriteCond %{REQUEST_URI} ^\/index\.php$
RewriteCond %{QUERY_STRING} ^category=([0-9]*)&page=1
RewriteRule ^(.*)category=([0-9]*)&page=1$ https://www.example.com/?category=([0-9]*)%1 [R=302,L]
I have already redirected all index.php with this code and works:
RewriteEngine on
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]