First you need to figure out what the actual url arguments are under the hood. The numeric part of sampleurl.com/5645654 will map to a $_GET variable name. IF you do not need the post title on the server script then its fine, you can forget that. The tool below is great for generating the .htacess rules
https://www.generateit.net/mod-rewrite/index.php