I managed to get some help from a previous question and I have the following in my .htaccess in my web root.
# 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$ /%2 [L,R=301]
# /h5k6 internally to /view.php?t=h5k6
RewriteRule ^/(.*) /view.php?t=$1
However, if I type in this: http://www.example.com/7hde it will just give me a 404 error.
Am I missing something?
Thanks all
Update
This what I have now:
# /view.php?t=h5k6 externally to /h5k6
RewriteCond %{THE_REQUEST} ^GET\ /view\.php
RewriteCond %{QUERY_STRING} ^t=([0-9a-z]+)$
RewriteRule ^view\.php$ /%1 [L,R=301,QSA]
# /h5k6 internally to /view.php?t=h5k6
RewriteRule ^([0-9a-z]+)$ view.php?t=$ [L,QSA]
It seems to work but I can not make use of the Query string. Every time I try to get the value of t. I get this "$"?!