Reputation: 4560
I have page url with pagination. Parameter category my be different
For exemple: http://domain.com/category?p=1
How can I redirect this url to: http://domain.com/category
using .htaccess
Upvotes: 0
Views: 283
Reputation: 18671
With that:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^p=1$
RewriteRule ^(.+)$ $1 [R=302,QSD,L]
[QSD]
work only since Apache 2.4.0. If it's not your case, use:
RewriteRule ^(.+)$ $1? [R=302,L]
Change R=302 for R=301 when test work well.
Upvotes: 1