Could anyone please help me to use .htaccess file to customize the profile page url like facebook profiles and some other social networking sites like twitter .
For all the users who are logged into my website the url is http://www.mywebsite.com/view/profile. But I want to change that url to http://www.mywebsite.com/username.
Is there any other option other than .htaccess to customize profile link?
You can check this out:
You can copy the above code and paste it on your .htaccess file.
The profile.php is your php file that will read the username.
You can check it out by creating a profile.php and use
and you will see the variable $_GET[‘username’]
and from there you can now query your sql.
* Just be careful for the sql injection and add some security.