![]() |
Tutorial Routing - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Tutorial Routing (/showthread.php?tid=73880) |
Tutorial Routing - pilot311 - 06-17-2019 Newby I am painfully working my way through the tutorial, and I am stuck on Routing. I added the two lines to config/routes.php. When attempting to go to index.php/about, I get "Forbidden: You don't have permission on this server" or "File not found" depending on which path I include in my URL address. I am using Mac Mojave. Please help. RE: Tutorial Routing - donpwinston - 06-17-2019 Post your routes and controllers. I take it you're doing the tutorial. You should be able to use just /home and /about without the index.php RE: Tutorial Routing - pilot311 - 06-17-2019 Yes, I am doing the tutorial. The tutorial said to add the second and third line below to config/routes.php. defined('BASEPATH') OR exit('No direct script access allowed'); $route['default_controller'] = 'pages/view'; $route['(:any)'] = 'pages/view/$1'; $route['default_controller'] = 'welcome'; $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE; Then the tutorial said to go to index.php/about, and I should see the view method in the pages controller. I added "administrators" and "all" to the permissions for the ci directory and all of its contents, and I restarted my Mac to install the new permissions. I always clear my browser cache before I try a new URL. I tried the following URL's with the following responses: 1. http://localhost:8888//ci/index.php/about "404 Page Not Found The page you requested was not found." 2. http://localhost:8888//ci/application/controllers/about "Forbidden You don't have permission to access /ci/application/controllers/about on this server." 3. http://localhost:8888//ci/about "Not Found The requested URL /ci/about was not found on this server." RE: Tutorial Routing - donpwinston - 06-17-2019 This is not CI4. Looks like you're using version 3. RE: Tutorial Routing - ciadmin - 06-17-2019 All your posted examples have double slashes after the port number. That will definitely cause problems, regardless of the CI version you are using! Your base_url setting is suspect. You should never have access to application/controllers from the browser in any case, for "forbidden" is normal. ps - moving this to "general help", as it does not pertain to CI4. RE: Tutorial Routing - InsiteFX - 06-18-2019 He also has two default controllers showing in the routes file. RE: Tutorial Routing - pilot311 - 06-19-2019 Thank you very much for alerting me to the existence of CI4. I downloaded it and while working with it a lightbulb went off. I received a "You don't have access to this file" and I remembered that a few months ago I deleted my permissions to be an administrator. Very embarrassing. Now I am going to contact a company here in the Research Triangle area to see if they can help me restore my administrator permissions on my Mac. I just don't know enough about using the Mac terminal. Please shelve this topic for now while I hopefully solve my Mac problem. I have a feeling that once that is done, I will not need to get back to the forum. |