Reputation: 757
I am looking for a condition/rule to rewrite any urls
www.mywebsite.com/?admin/*
to
www.mywebsite.com/admin/*
so ?admin to admin
AKA remove that question mark from the URL (only when followed by admin obviously). I know it's a weird URL but that's a long story, all I need is to rewrite all admin URLs so that the query question mark is removed.
Thank you
Upvotes: 0
Views: 299
Reputation: 9245
Try the rule below
RewriteEngine On
RewriteCond %{THE_REQUEST} \s/+\?(admin[^\s&]+) [NC]
RewriteRule ^ /%1? [R=301,L]
Upvotes: 1