Welcome Guest, Not a member yet? Register   Sign In
routing problem
#1

[eluser]Unknown[/eluser]
Hello together.
the roouting doesn't seam to work, or I've configured the wrong way.

I have a root folder: www.mysite.com/cm13 and have set this in the config.php
Code:
$config['base_url'] = 'http://www.mysite.com/cm13/';
...
$config['uri_protocol'] = "REQUEST_URI";

In the routes.php file I've set the following:
Code:
$route['default_controller'] = "welcome";
$route['404_override'] = '';
$route["users"] = "users";

//For pages those have a static name
$route['{default_controller}/{default_method}/about.html'] = "{original_controller}/{original_method}";

//rule to rout request with number values
$route['{default_controller}/{default_method}/:num'] = "{original_controller}/{original_method}";

//rule to rout request with regular expression values
$route['{default_controller}/{default_method}/([a-z]+)-{delimiter}'] = "{original_controller}/{original_method}/$1";

My htaccess file hase the following code:
Code:
<IfModule mod_rewrite.c>

    RewriteEngine On
    RewriteBase /cm13/

    # Disable rewrite for valid directory/files
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    #map all request urls to a specific controller method
    RewriteRule ^(.*)$ index.php?/{controller}/{method}/$1 [L]
</IfModule>

The users controller:

Code:
class Users extends CI_Controller {

public function index()
{
       echo "UsersIndex<br>";
}
}

but when I try to call http://www.mysite.com/cm13/users, I get an 404 error message.
What can I do? Or what have I done wrong?


Messages In This Thread
routing problem - by El Forum - 02-09-2012, 06:32 AM
routing problem - by El Forum - 02-09-2012, 07:38 AM
routing problem - by El Forum - 02-09-2012, 09:34 AM
routing problem - by El Forum - 02-09-2012, 11:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB