Is this to avoid other users to open up other users private messages with messageID=4321 and so on? Because then this way is no way to go!
You should check that the user that is opening a message is actually allowed to do so.
If the messages is non private, and you just don't wan't people to incrementially view messages by modifying the number. Then you could add a 'messageKey' field to the database and setting random strings of a specified length. Example http://www.mymessager.com?messageKey=jadg23sf34lhs
Now just search in the DB for messages with that messageKey. Just remember to make sure that the messageKey is unique.
In this way you could also set the messageKey to something easy to remember, or SEO perhaps friendly. As long as it's unique.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…