Lovely User URLS (http://domain.net/~Username) |
[eluser]IamPrototype[/eluser]
[quote author="pyromaniac" date="1232390860"]It wouldnt get to the controller, as the username would be used as the controller name and a 404 would be returned. You could use routes, but then EVERY 1 uri segment will be checked as a username. The way I like to do this is to add a URL suffix in the config file (meaning add .html or similar to all your pages) then use the following mod)_rewrite rules: Code: <IfModule mod_rewrite.c> That is basically a standard CI .htaccess with an extra rule in it. Any URI segment 1 with a-z, 0-9, - or _ in it which does NOT have a URL suffix will go to a controller which will take the username and show the correct profile. If you have mod_proxy enabled you could even swap the flag [L] with [L,P] to make the URL stay as example.com/username.[/quote] Thanks, I guess this example is better for use. So everything I have to do is write that into my .htaccess and then it should work by itself? ![]() Etc http://domain.net/IamPrototype turns into http://domain.net/profiles/view/IamPrototype |
Welcome Guest, Not a member yet? Register Sign In |