Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5928675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:19:11+00:00 2026-05-22T14:19:11+00:00

I am trying to get this URL to work on a codeigniter installation, just

  • 0

I am trying to get this URL to work on a codeigniter installation, just installed the newest version today (2.0.2):

http://mydomain.com/pete/ci_test/accounts

So I have set my default controller in routes.php to test.php, and inside my controller, test.php I have this code:

class test extends CI_Controller {

public function index() {
    $this->load->view('test');
}

public function accounts() {
    $this->load->view('accounts');
}
}

and then I have a test.php and an accounts.php inside my views, it loads the test.php view when I go to http://mydomain.com/pete/ci_test/

But when I go to http://mydomain.com/pete/ci_test/accounts it gives me a 404. I have been reading the Getting Started and it says “By default CodeIgniter uses a segment-based approach”, and then gives an example similar to what I’m doing. But then I read a little further it says: “By default, the index.php file will be included in your URL” . So I added this into my htaccess file (located at mydomain.com/pete/ci_test/.htaccess):

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

I made sure that the module is loading inside httpd.conf. It still doesn’t go to my accounts.php view. I have also tried:

http://mydomain.com/pete/ci_test/index.php/accounts

But another 404, what am I doing wrong? Any advice would help, thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:19:11+00:00Added an answer on May 22, 2026 at 2:19 pm

    Default controller is what loads when there are no url segments present – that’s it.

    If you want /accounts to load the test controller and accounts method, you’ll have to use a route like this:

    $route['accounts'] = 'test/accounts';
    

    Otherwise you’ll have to have an accounts controller or access it through /test/accounts/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to get this to work: http://addyosmani.com/blog/autosave-changes-chrome-dev-tools/ I have never worked with node.js nor
Trying to get this example working from http://www.munna.shatkotha.com/blog/post/2008/10/26/Light-box-effect-with-WPF.aspx However, I can't seem to get
I'm trying to get nearby venues. I found this url where i can just
I'm very unfamiliar with Oracle and am just trying to get this to work.
Im trying to get the last string from a URL for example... http://www.mywebsite/blog/this-post I
I'm trying to get an HttpRequest to post this URL https://www.iformbuilder.com/exzact/_emptyTable.php?PAGE_ID=1234&TABLE_NAME=table_name_here&USERNAME=yo@yo.com&PASSWORD=What!What ! I've tried
I am trying to rewrite an url with GET-data from a form. This works
Trying to get this to work, with no luck: [DataMember] public Type ParameterType {
I've been trying to get this code to work for hours! All I need
I'm trying to get this css layout to work with IE7 and I'm a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.