RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
in official htaccess make pretty url, like:
http://www.mydomain/title
Ive found that non pretty url are still accessible:
http://www.mydomain/index.php?page=title
What could i add to make them 301 redirect to pretty url.
Ive tried adding a 301 redirect flag like
RewriteRule ^(.+)$ index.php?page=$1 [QSA, r=301]
Which breaks the whole web

And adding a rewrite after that one like this
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
RewriteRule ^/index.php?page=$ /$1 [R=301,NC,L]
That im sure you can tell from reading that line, i dont understand how to properly lay a rewrite.
Ive read a lot, but is like trying to know about something that is in the middle of a lot of other server concepts that are beyond my scope and knowledge.
As i understand that would be something useful for anyone, could someone come with a proper rewrite to add after the oficial one, or a new version of the official one, that would redirect 301, those unused urls.