I was spoon fed this htaccess file from Gumbo and I am grateful for it as I learnt a lot. However, I made some changes and reverted back and forth and managed to make some small changes again, it works 80% but there is a case when it doesn't work:
If I type in http://www.example.com/view.php?t=45re it rewrites successfully but it does this in the URL http://www.example.com/?t=45re I can't see how that is happening. Anymore help greatly appreciated.
# REWRITE DEFAULTS
RewriteEngine On
RewriteBase /
# /view.php?t=h5k6 externally to /h5k6
RewriteCond %{THE_REQUEST} ^GET\ /view\.php
RewriteCond %{QUERY_STRING} ^([^&]*&)*t=([^&]+)&?.*$
RewriteRule ^view\.php$ / [L,R=301]
# /h5k6 internally to /view.php?t=h5k6
RewriteRule ^([0-9a-z]+)$ view.php?t=$1 [L]