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

How to route a query string in a codeigniter Search?

I have a question with route a query string. I'm trying to route with codeigniter a search. I have some parameters for each search, first a input text field, for a title or a description. Second, I have categories like, Utilities, Games, Exercise...…
croigsalvador
  • 1,993
  • 2
  • 24
  • 47
0
votes
1 answer

How do I attach a user id to a url in code igniter?

I am creating the user module on my social network. I am trying to set it up to where if you are signed in and looking at your own profile you are $user['id']; and if you are signed in and looking at someone else's profile you are $prof['id']; which…
LightningWrist
  • 937
  • 4
  • 20
  • 37
0
votes
1 answer

Fix canonicalization of News section for Codeigniter site

Google is indexing my news articles as: https://www.site.com/news/id5- and: https://www.site.com/news/id5-title-of-article In fact, it indexes both, but omits the full URL version in results. Both URLs resolve to the same address, but I want to…
0
votes
0 answers

Codeigniter Url Rewriting without any controller or method or any other word except domain name/ product name

I need to change my Url's from http://www.website.com/controller-name/method-name/id/ to http://www.website.com/Art-Coupon-Codes this is a single example.How can this be done in codeigniter
Sahil Agarwal
  • 79
  • 1
  • 11
0
votes
4 answers

Pretty URLs for Code igniter

I want to know whether it is possible to write pretty URLs in Code igniter or not? I mean i have a code igniter project in which i am displaying data from uri segments like this: http://myproj.local/category/subcategory/64/239 where 64 is the id of…
0
votes
2 answers

Codeigniter can't use this->uri->segment(3) as value in function

Why this code is ok $this->sch_teacher_id = $this->ion_auth->user_by_username("vika")->row()->id; But this doesn't work? $this->sch_teacher_id = $this->ion_auth->user_by_username($this->uri->segment(3))->row()->id; My url is…
almix
  • 289
  • 1
  • 9
  • 23
0
votes
5 answers

codeigniter - changing url for better SEO

How can i change the following url from: http://localhost/autoquest/index.php/autos?category=camry to: http://localhost/autoquest/index.php/autos/camry using codeigniter. The category option camry comes from a select option such as:
Slimtugo
  • 97
  • 1
  • 9
0
votes
2 answers

Redirect when wrong parameter in CodeIgniter

E.g. I have a working url: http://localhost/article/154 Where 154 is $id of the article in db and a controller article looks like e.g.: function index ($id = '') { // some code here } Now, when I type something…
Derfder
  • 3,204
  • 11
  • 50
  • 85
0
votes
1 answer

Avoid automatic PHP routing in a MVC

I am using a MVC and on my application file, I am routing this way : # Routing $routing = array( '([a-zA-Z]+)\/?' => array('Post', 'view') ); framework::routing($routing); It means that all the URLs like "mysite.com/anything/" will be…
pimarc
  • 3,621
  • 9
  • 42
  • 70
0
votes
3 answers

routes.php and controllers (codeigniter)

I have two controllers 1- site 2- management the first controllers(Site) is work successfuly the second controllers(Managemnt) is not work. I don't know what is the errror I change the routes.php but still doesn't…
bosami
  • 123
  • 2
  • 11
0
votes
4 answers

Handling Sub-Sections of a Site—Codeigniter

I'm fairly new to Codeigniter as well as MVC and I'm having a bit of trouble figuring out the best way to accomplish this. I need to build an app that allows users to apply to various programs offered by some institutions. However, these…
Vecta
  • 2,312
  • 5
  • 28
  • 47
0
votes
4 answers

Use same function for both 'add' and 'edit' in Codeigniter?

I want both these urls: /admin/users/add and /admin/users/3/edit to point to edit($user_id = 0) function in my users controller. The number 3 in the second url has to be passed to the $user_id parameter. How can I do this in a smooth way?
Peter Westerlund
  • 741
  • 1
  • 10
  • 36
0
votes
2 answers

mvc configuration on web server

I recently uploaded my codeigniter project onto my web server. it's in a folder called project1 this is what my directory view looks like [www.myurl.com] |-> project1 |-> application |-> css |-> images |-> js I am…
Undermine2k
  • 1,481
  • 4
  • 28
  • 52
0
votes
1 answer

Method name as Route - codeigniter

How can I do the following in routes dynamically? $route['notifications'] = 'admin/notifications'; $route['categories'] = 'admin/categories'; This means that any method name under my controller is the landing page. I don't want the admin controller…
ruelluna
  • 787
  • 1
  • 11
  • 30
0
votes
2 answers

Using any other controller class rather than the default controller class

I am working with CodeIgniter. Here's my routing file $route['default_controller'] = 'pages/view/home'; $route['(:any)'] = 'pages/view/$1'; where pages is the controller class and view is a function of it and home is a parameter to that…
Saaram
  • 337
  • 3
  • 7
  • 29