The URLs of my website are in the form...
www.website.com/index?t=abc123
...where abc123
is a 6 character hex code. How can I use htaccess to redirect all addresses like this to...
www.website.com/abc123
...but still serve the content at the original URL?
So, for instance, typing...
www.website.com/index/php?t=5f33ee
...would redirect to...
www.website.com/5f33ee
...but would serve the content from...
www.website.com/index.php?t=5f33ee
...without the user being redirected.
So far, my .htaccess looks like this. The first bit, I understand, redirects all not https traffic to https. The second RewriteRule seems to work to serve the content from the short url.
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.website\.com$ [NC]
RewriteRule ^(.*)$ https://www.website.com/$1 [R=301]
RewriteRule ^([0-9a-f]{6})$ index.php?t=$1 [L]