0
votes

I installed an application built with CodeIgniter on my local computer which has MAMP. The home page contains a bunch of links to other pages. Clicking any of the links doesn't do anything. The page just refreshes but the browser doesn't redirect. Looking at this piece of ducumentation, I think that the URI doesn't have any data and therefore it just goes back to the home page. What do I need to do to test this and fix it?

There are three reserved routes: | | $route['default_controller'] = 'welcome'; | | This route indicates which controller class should be loaded if the | URI contains no data. In the above example, the "welcome" class | would be loaded.

2
it does use session or not? - curiosity
I'm not sure what that means or how to check. - MG1
it needs to login? - curiosity
no. The home page has a bunch of links that need to redirect to other modules within the application. But when I click it, the URL changes but the page remains the same. I think it has to do with the URI not loading data. - MG1

2 Answers

1
votes

change your .htaccess to Codeingiter's provide htaccess file below.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

place that to your root application folder.

1
votes

Set the base_url of your application in config.php to the same url you are using to access the website, it should be something like this:

$config['base_url'] = "http://localhost/your_app_directory_name";

It should work.

For .htaccess use this:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]