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
4
votes
1 answer

CodeIgniter routes are not working

I've defined following route in config file as follows. $route['apartments/(:any)'] = 'apartments/view/$1'; If I give http://localhost/apartment_advertisement/apartments/shobha_complex like this in url it works perfectly fine. If I give…
user1275378
4
votes
2 answers

Codeigniter routing and REST server

I'm trying to achieve the following URLs for my API (I'm using Codeigniter and Phil Sturgeon's REST server library): /players -> refers to index method in the players controller /players/rookies -> refers to rookies method in the…
gregory
  • 1,140
  • 2
  • 11
  • 27
3
votes
2 answers

Codeigniter - uri routing, skipping a segment

I'd like to skip a section of a uri with Code Igniter. I have the following urls /about /info /admin/users /admin/pages /admin/pages/edit/123 However I'd like to skip admin when searching for the class, i.e. the default config acts like…
Not-in-use
  • 79
  • 9
3
votes
3 answers

How to create URL & Read on Codeigniter?

How to create dynamic URL in Codeigniter?. I've following table which stores basic article details: 1. ID 2. Article Title 3. Content 4. Tags 5. Status 6. Create Time 7. Update Time 8. Author ID 9. Status Now I want to know how to create…
Mr.Happy
  • 517
  • 1
  • 9
  • 25
3
votes
4 answers

How to load hook for particular controller

I am new in codeigniter. I want to load hooks for admin panel controller. $hook['post_controller_constructor'][] = array( 'class' => 'AdminData', 'function' => 'myfunction', 'filename' => 'loginhelp.php', 'filepath' => 'hooks', …
Pavnish Yadav
  • 2,728
  • 3
  • 15
  • 14
3
votes
1 answer

codeigniter routes any or num not working

I have url like that http://lp.dev/sisters/adab/1 but the route is not working when i use (:num) or (:any) to get the value 1 because the route give me 404 page routes as follows $route['default_controller'] =…
3
votes
2 answers

removing index.php in codeigniter (works fine locally but not on the production)

I've spent much time searching for an answer but found nobody with the same issue :). My local version is fine (running on ampps), the urls without index.php are working great. My local and prod folders are both in subfolders so it's like…
banibanc
  • 143
  • 3
  • 16
3
votes
2 answers

404 error in codeigniter pagination

I see a lot of this question, but I couldn't solve the issue. I suspecting that it doesn't read the right segment as I have a reroute config and htaccess to remove the index page. The code is throwing a 404 page. Here is my Model: public…
3
votes
1 answer

Issue with Codeigniter Pagination And Search

I am trying to give facility of pagination and search keyword in one report with Code-igniter Framework. Below is the Controller code for that…
Explorer
  • 177
  • 6
  • 17
3
votes
1 answer

easy hack for routing codeigniter to third_party examples files

I have to install 10+ APIs in my third_party folder, each has it´s own examples files for testing oauth validation and other features. without too many changes, has anyone found an easy way to hack the Codeigniter routing to execute files…
E.A.T
  • 848
  • 11
  • 24
3
votes
1 answer

URL with trailing slashes leads to different pages - MVC CI

I have a routed like the following in my Code Igniter route file. $route['profile'] = "profile"; The class profile contains the following $this->load->view('pages/profile.php'); Now I have a link on my profile.php page which looks like the…
Srivathsan
  • 600
  • 3
  • 9
  • 19
3
votes
2 answers

routes.php file not loading when using hmvc in codeigniter?

I have hmvc setup and working fine, I have a gallery module. The gallery module breaks down into three controllers and it's structure is as…
Hailwood
  • 89,623
  • 107
  • 270
  • 423
3
votes
3 answers

CodeIgniter URL Segment-Based

I want my URL's to look like: www.domain.com/controller/view/args instead of index.php?/controller/view/args. Actually, I NEVER want the url "index.php?..." to validate. Can anybody give me a hint on how to enforce this behavior, because when I do:…
Exegesis
  • 1,028
  • 1
  • 18
  • 47
3
votes
1 answer

Codeigniter URL: How to display id and article title in the URL

Please see the following link structure http://stackoverflow.com/questions/10672712/voting-system-like-stackoverflow In the above link the 10672712 is the question id I guess, because if you check the following link you will get to the same…
black_belt
  • 6,601
  • 36
  • 121
  • 185
2
votes
2 answers

Codeigniter admin route

I am stuck with this problem. I get 404 error when try to access admin pages in codeigniter, I can only access the fronted pages. Here you have my route.php file: $route['default_controller'] = "page"; $route['404_override'] = ''; $route[':any'] =…
prezequias
  • 267
  • 1
  • 5
  • 17
1
2
3
16 17