I am doing a rewrite from .htaccess
file to redirect pretty links to original URLs:
RewriteRule ^users/?$ /?status=users [NC,L,QSA]
which redirects my SEO/pretty link:
example.com/users
to the real URL
example.com/?status=users
Then again I want any search engine bot (or anyone else) who tries to get to
example.com/?status=users
to be 301 redirected to the pretty link
example.com/users
I know I could get the later part done using
RewriteCond %{QUERY_STRING} (^|&)status=users($|&)
RewriteRule ^$ /users? [L,R=301]
But I can't use these two together as it gets into a never ending loop and the browser displays "redirected you too many times".
I think I get what the problem is here, but what is the solution? How do I achieve both?