Welcome Guest, Not a member yet? Register   Sign In
Routing URL && Sub domains
#1

[eluser]IronicNet[/eluser]
Hi!
Im'm quite new at Ci, but since i saw the videos and the documentation (great work!) i fell in love immediatly!... (and i come from a .net world!)

Well, i'm having the following problem...

I have an application which each user can see their profile... the way to do this is the following:
Quote:http://www.domain.com/username

I used to do it via .htaccess, but now im trying to do it the CI way!...

i have the following controller :
(user.php)
Code:
<?php

class User extends Controller {

    function User()
    {
        parent::Controller();    
    }
    function view()
    {
        echo "View";
    }
    
    function index()
    {
        echo "Index";
    }
}
?>
and this is the routing file:
(routes.php)
Code:
$route['default_controller'] = "user";
$route['scaffolding_trigger'] = "";
$route['([a-zA-Z0-9_-]+)'] = "user/view/$1";

if i type "www.domain.com" it shows "Index"...
but if i type "www.domain.com/someusername" it throws a 404 error.
but if i type "http://www.domain.com/index.php/username" it shows me "View".

Any suggestions? some help?

I'm sorry, i didn't find any post with this... or i tried the wrong keywords...


Messages In This Thread
Routing URL && Sub domains - by El Forum - 04-09-2008, 12:49 PM
Routing URL && Sub domains - by El Forum - 04-09-2008, 01:35 PM
Routing URL && Sub domains - by El Forum - 04-09-2008, 01:48 PM
Routing URL && Sub domains - by El Forum - 04-09-2008, 03:36 PM
Routing URL && Sub domains - by El Forum - 04-09-2008, 05:43 PM
Routing URL && Sub domains - by El Forum - 04-13-2008, 05:07 PM
Routing URL && Sub domains - by El Forum - 04-13-2008, 05:35 PM
Routing URL && Sub domains - by El Forum - 04-14-2008, 07:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB