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

Rewrite the url using CodeIgniter

I read a lot of forum topics but I did not found any answer which meets my needs. I am running a blog system and my current urls for each article look like: www.example.com/controller/method/id. However, for each article I have a title stored in a…
user2586419
1
vote
1 answer

How to set Custom Page for 403 Forbidden Error in CodeIgniter

I am developing a web site using CodeIgniter. I have already have a custom 404 Error Page. But now i want to add a custom page for 403 Forbidden Error. Can you help me? I have used this code for 404 $route['404_override'] = 'Error';
1
vote
1 answer

URL base changing after using any controller with parameters

i'm having an problem with the URL of Codeigniter. When i use one controller with parameter, example: localhost/ci/products/news (where localhost/ci is the url base), after i click in any element , example: Codeigniter…
vaati
  • 162
  • 2
  • 13
1
vote
2 answers

CodeIgniter routes doesn't work

I have a problem that looks beast, but googled and can not resolve ... I'm using CodeIgniter and only the route $ route ['default_controller'] = 'welcome'; is working when I do an example: $ route ['test'] = "welcome"; it gives me the following…
LigDark
  • 53
  • 5
1
vote
1 answer

multi user website in codeigniter

I want to build a multi user website where my users register and their account is created. After sign up the user gets a specific url to build his website. Like. Mysite.com/user1 Now the user can login to the control panel and publish his data. Eg…
1
vote
1 answer

MVC index.php in every url

I started using codeigniter for the first time today although I have used asp.net mvc before. I am wondering why my URL needs the index.php at the start all of the time…
LiverpoolOwen
  • 806
  • 2
  • 10
  • 25
1
vote
2 answers

Codeigniter routes don't work correctly

I have two string in routing config. $route['education/course/(:any)'] = "education/course/$1"; $route['education/course/(:any)/(:num)'] = "education/lection/$1/$2"; But when I went to /education/course/my_course/1, the first rule worked, but the…
1
vote
1 answer

How to organize country/state/city browsing in codeigniter url

I'm creating a website that includes a country/state/city browsing interface. For SEO purposes, I want to include the name of the country/state/city in the URL. For example, the URL may include additional variables and would be something…
1
vote
3 answers

codeigniter 404 page not found in intranet deployment

Please guide me what is the issue? All of my pages are showing 404 not found in intranet deployment, while main (home) page is viewing fine. .htaccess RewriteEngine On RewriteBase /dna/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond…
1
vote
1 answer

When my controller function loads a view, the URL has the controller name and function still in the URL. How can I get rid of this?

Basically my function checks to see if something is in a database. If it's found it returns true and carries on to the next view. However, if it returns false it reloads the home.php view but it seems to still leave URI segments in the…
EHU-Lewis
  • 75
  • 1
  • 1
  • 10
1
vote
1 answer

Conditional Routing in Codeigniter

I've searched all over for this and can't seem to find a solution anywhere. Does anyone know how to setup a conditional route in CI? For example if the user is logged in then the default_controller should be documents but if not then it should be…
Jordan Adams
  • 434
  • 1
  • 8
  • 18
1
vote
1 answer

how to redirect a short url to original url in codeigniter

I want to make a url shortener for my project using CI. I can short long url but problem is that after short this i can't redirect it original url. Here is my controller code.
1
vote
2 answers

CodeIgniter and Old-style PHP

I have a domain, let's say somedomain.com. I have an admin page somedomain.com/admin. The pages were coded in plain PHP. I recently re-wrote somedomain.com in CodeIgniter. But I do not want to touch somedomain.com/admin for now. How do I make…
Eric
  • 3,165
  • 1
  • 19
  • 25
1
vote
2 answers

MVC Code Igniter 403 Error

Hello all i am new to MVC and after attempting a mod_rewrite i am having trouble with 403 when i attempt to load site/about. I have my project in the main root directory of my web server htdocs, i have struggled to understand many of the tutorials…
1
vote
3 answers

How to make codeigniter user profile url look pretty

I am trying to figure out the best way to make a nice looking profile URL in codeigniter. Normally i would just like to a controller with a third url paramter (the profile id) like so: http://thesite.com/profile/4 ====== This isn't going to work for…