I am attempting to rewrite the next into htaccess using - redirect 301

redirect "mysite.com/longname/" to "mysite.com/shortname/"

essentially to redirect the "longname" to "shortname" and cut the "20 character string" towards the first 10 figures

then when Time passes to mywebsite.com/longname/aaaaabbbbbcccccddddd, it rewrites it into mywebsite.com/shortname/aaaaabbbbb

This is what I've to date:

RewriteEngine On
RewriteRule /longname/(.*) /shortname/$1 [R=301,L] 

You need to have the ability to limit the input utilizing a regular expression for example:

RewriteEngine On
RewriteRule /longname/(.{0,10}) /shortname/$1 [R=301,L] 

This can match a string of -10 figures following /longname/.