Questions tagged [codeigniter-routing]

Questions about routing a particular URI, or pattern of URIs to a controller class and method, within the CodeIgniter PHP framework.

In CodeIgniter routes are defined in the application/config/routes.php file. Routes can simply be added to the array $route. CodeIgniter supports both wildcard and regular expression based routing rules in addition to static ones.

Read more in the CodeIgniter documentation.

245 questions
0
votes
2 answers

Codeigniter Routes Conflict

I am using codeigniter to create a restapi and I am having some problems with routes. Here is the equation: I have to navigate /users/ to index function, I have to navigate /users/{MongoId} to /users/show/{MongoId}, I have to navigate…
Hilmi Erdem KEREN
  • 1,949
  • 20
  • 29
0
votes
1 answer

CodeIgniter: Redirect URL with subdomain

I am trying to redirect a subdomain URL to a controller method. Complete url is http://subdomain.domain.com/urlofservice/servicename.svc Part1 I have configured subdomain from hosting service's control panel. Which is redirecting…
Himanshu Yadav
  • 13,315
  • 46
  • 162
  • 291
0
votes
3 answers

Sounds simple but It is not working: Import CSS in CodeIgniter 2.1.3

I Just downloaded CodeIgniter 2.1.3 and Trying to import css into via header_controller, I have tried SOF: CodeIgniter - Loading CSS, CI_Help_page and codeigniter CSS problem (SitePoint Form Thread). I'm currunlty utterly confuse and Can't find the…
DPP
  • 12,716
  • 3
  • 49
  • 46
0
votes
3 answers

CodeIgniter: I'm able to list the items but I can't load one

My Application/.htaccess RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] Application/config/routes.php $route['default_controller'] = "news"; $route['404_override'] =…
Toni Michel Caubet
  • 19,333
  • 56
  • 202
  • 378
0
votes
1 answer

Remove unwanted URL segments in Codeigniter site_url

On the page whose URL is "abc.com/en/login/create_member" using site_url('login') produces a link to "abc.com/en/login/create_member", but the desired URL is "abc.com/en/login/" I've included the link code and an excerpt from my routes.php…
jsuissa
  • 1,754
  • 6
  • 30
  • 64
0
votes
1 answer

How to build CodeIgniter site correctly

I'm building a website using CodeIgnitier. My problem is how can I use the MVC pattern inside a webpage. Let's say I have a controller called "Settings", Within this page I want to divide the settings into categories, with tabs, like "System",…
Yaakov
  • 184
  • 1
  • 8
0
votes
1 answer

Custom URL rewriting not working in codeigniter

I use the code below in a Codeigniter htaccess file RewriteRule ^([^.]+)-vacation$ /search?location=$1 When i access it with the url www.example.com/moscow-vacation, it gives me a 404 error. I have used the above htaccess code in a core php…
0
votes
2 answers

How to route codeigniter routes for accesing users like in Facebook (www.facebook.com/username)

I'm using codeigniter framework and by default i load my site controller $route['default_controller'] = "site"; But now i want to setup the routes.php config so i could still access my controllers as before but if controller doesent exists then…
BoonZ
  • 443
  • 1
  • 6
  • 16
0
votes
4 answers

how to pass id in controller from form action using codeigniter

hey guys i am new in codeigniter,i have a form like this
//some code
i have a controller…
0
votes
1 answer

CodeIgniter router not working

I have a single page web site so all routes should lead to the default router. This is my base url: $config['base_url'] = 'http://mysite.cz'; This is a rewrite base from htaccess: RewriteBase / And finally the…
hjuster
  • 3,985
  • 9
  • 34
  • 51
0
votes
1 answer

CodeIgniter routing issue, advice how to do it

I'm not CI programmer, just trying to learn it. Maybe this is wrong approach, please advice. my controller(not in sub directory) : class Users extends CI_Controller { function __construct() { parent::__construct(); } public…
user147
  • 1,312
  • 5
  • 22
  • 41
0
votes
1 answer

How to extend anchor() function to anchor_admin() in CodeIgniter?

I would like to create my own function called anchor_admin() based on anchor() function in CodeIgniter. I was thinking like: I have defined admin path in config.php file e.g. like this: $config['base_url'] = ''; $config['base_url_admin'] =…
Derfder
  • 3,204
  • 11
  • 50
  • 85
0
votes
1 answer

Is this a safe / standard way of using reserved names in a CodeIgniter install?

For simplicity, I would really like my URLs for adding and listing of items to look like: inventory/list inventory/new Of course, list and new are reserved in PHP so I can't use them as CodeIgniter function names. My workaround was to give my…
Steven Sokulski
  • 354
  • 1
  • 4
  • 17
0
votes
1 answer

Codeigniter - Search profile using username entered in URL

I am using Codeigniter and Tank Auth and I am using Ubuntu OS. When I access my project using my IP, it comes something like: http://192.168.1.10/project/auth/login I have to implement a functionality of searching a profile using URL. Suppose if I…
V15HM4Y
  • 1,757
  • 4
  • 26
  • 40
0
votes
1 answer

Codeigniter routing how to permit null parameter

I want paginate my index http:localhost/mysite/home but if I write only this http:localhost/mysite/home the page said: "page not found", but if I write http:localhost/mysite/home/3 its work! how to I can configure my routing to get null parameters?…
vljc2004
  • 157
  • 3
  • 13