I am developing an app using PHP and I would like my users to be able to use their own vanity URLs.
In this format:
http://example.com/username
For example:
http://example.com/myCoolUsername
If I use this URL now the server thinks it is a folder but I know I should use a .htaccess file in a way but I do not know what content I should use in that file.
This rule will rewrite
http://domain.com/usernametouser.phpwithusernameas GET parameter (name).To test, create a file named
user.phpin your directory root ant put that in your file:Access
http://domain.com/blablaName123and if everything works fine you should seestring(13) "blablaName123"