url friendly, redirect users to other users profile by usename |
Hello everyone
is it possible in codeigniter to redirect users by username in my site when users are logged in the url is like this: http://localhost/friendmiiDemo/posts when they are on their profiles the url is like this: http://localhost/friendmiiDemo/profile?u=abelo3088. i want when users type other username on url like this: http://localhost/friendmiiDemo/abelo3088 be redirected to this users profile, so inside profile view i putted .htaccess file with this code:[url=http://localhost/friendmiiDemo/posts][/url] Code: RewriteEngine On but it just wont work i don't know if is codeigniter or htccess. if you can help or there is any other way i could do this please help Thanks in advance.
You can replace http://localhost/friendmiiDemo/profile?u=abelo3088 by http://localhost/friendmiiDemo/profile/abelo3088 by passing the username as a parameter to your method like this:
PHP Code: <?php
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Welcome Guest, Not a member yet? Register Sign In |