may be unsafe as its displaying the name of the table
That's a popular myth among inexperienced developers. Url obfuscation makes the site unusable to humans (they now can't tell one page from another), will complicate your code immensely and, most importantly, will not add any security.
I mean, if you have a blog site, for example, one can assume, with high degree of confidence, that you have a table named posts
. Now we're back to square one, only now we have ugly urls.
If your concern is security of your site, I suggest that you learn proper techniques and tools/libraries for authentication, authorization, etc.
Here's the official recommendation: Avoid Security by Obscurity.