Welcome Guest, Not a member yet? Register   Sign In
<domain name>/<username>
#1

[eluser]yazid[/eluser]
Hi everybody,

For my website, i need to add the feature to open user own profile through writing the user name after the domain name, means for example if my name is "Yazid", and my domain name is www.domain-name.com, i would enter www.domain-name.com/yazid to access my profile, which has the url: www.domain-name.com/index.php/index/myshowroom/<my ID>, how to implement this please?

By the way, what does this feature called? and is there any suggestions?

Thanks in advance for your effort.
#2

[eluser]Dennis Rasmussen[/eluser]
In your config/routes.php file add the following route:

Code:
$route['404_override'] = 'Controller/Method';

This will send all domain.com/<anything> urls to that controller and method.
But then make sure that you don't have any profile names that match any controllers Smile
#3

[eluser]yazid[/eluser]
Oh, Thank you Dennis, this is very useful for me, i am really thankful for the quick reply also Wink
i tried it and it worked properly, but do you know what does this feature called?
#4

[eluser]Dennis Rasmussen[/eluser]
I'm sorry, but I don't know the name of the feature Sad
I'm new to CodeIgniter myself.
#5

[eluser]yazid[/eluser]
Thank you my friend, your answer was enough, but i don't know why it doesn't work any more, when i put any variable, it redirects me normally to the 404 error page, just as i didn't add the routing line! do you have any idea, what would be the reason?




Theme © iAndrew 2016 - Forum software by © MyBB