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

  • Home
  • SEARCH
  • 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 9009913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:19:25+00:00 2026-06-16T02:19:25+00:00

Possible Duplicate: .htaccess throws a 500 error I am using CodeIgniter and need to

  • 0

Possible Duplicate:
.htaccess throws a 500 error

I am using CodeIgniter and need to get rid of the “index.php” in the URL.
I copied the .htaccess file from CI tutorial, emptied the $config[‘index_page’] = ”;
and put the .htaccess in the root directory.

  • Without the .htaccess file it works fine, but ugly: http://www.example.com/index.php/site/home
  • For some reason it’s not working and just throws a 500’s error.
  • In the log there is a row that repeats itself in every attempt: [Thu
    Dec 20 04:01:13 2012] [alert] [client 2.55.118.161]
    /home/morro1980/data/www/knight-guard.org/.htaccess:
    directive requires additional arguments.
  • The mod_rewrite is installed and working

Where is the bug and how can I resolve it?

Thank you in advance

My .htaccess file:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    #Removes access to the system folders by users.
    #Additionly this will allow you to create a System.php controller,
    #previously this would not have not been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    #When your application folder isn't in the system folder
    #This snippet prevents user access to the application folder
    #Submitted by: Fabdrol
    #Rename 'application' to your applications folder name.
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php/$1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
<IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php? and everything works as normal.
    # submitted by: ElliotHaughin
    ErrorDocument 404 /index.php
</IfModule>

My site controller:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Site extends CI_Controller {
    public function index(){
        $this->home();
    }
    public function home(){
        echo "default function started.<br/>";
        $this->hello();
        $data['title'] = 'Home!';
        $data['name'] = 'Ilia';
        $data['fname'] = 'Lev';
        $data['operation'] = 'minus';
        $data['val1'] = 5;
        $data['val2'] = 7;
        echo $data['operation']."<br/>";
        $data['result'] = $this->math($data);
        $this->viewLoad("home_view", $data);
        echo "<br/>";
    }
    public function hello(){
        echo "hello function started.<br/>";
    }
    public function math($data){
        $operation = $data['operation'];
        $val1 = $data['val1'];
        $val2 = $data['val2'];
        $this->load->model("math");
        return $this->math->calculate($operation, $val1, $val2)."<br/>";
    }
    public function viewLoad($whatToView, $data){
        try{
            $this->load->view($whatToView, $data);
        }catch(Exception $e){
            echo "There is no such view";
        }
    }
    public function about(){
        $data['title'] = "About!";
        $this->viewLoad("about_view",$data);
    }
}
  • 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-06-16T02:19:27+00:00Added an answer on June 16, 2026 at 2:19 am

    The first <ifModule> is not closed, this:

    RewriteRule ^(.*)$ index.php?/$1 [L]
    <IfModule>
    

    has to be

    RewriteRule ^(.*)$ index.php?/$1 [L]
    </IfModule>
    #^
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to add .php extension using .htaccess url rewriting? I want to
Possible Duplicate: how to remove index.php from url in codeigniter ? I want to
Possible Duplicate: Url Rewriting Help How do I get a url ending in /index.php?p=2
Possible Duplicate: Shorten the URL from example.com/page.php?var=letters to example.com/letters Using htaccess, is it possible
Possible Duplicate: .htaccess rewrite to redirect root URL to subdirectory I need to change
Possible Duplicate: Access GET variables with PHP + .htaccess I am trying write a
Possible Duplicate: HTTP authentication logout via PHP I’m using .htaccess (and .htpasswd ) to
Possible Duplicate: Rewrite all queries to not need the .php extension using a mod_rewrite
Possible Duplicate: .htaccess rewrite image file to php script How can I execute a
Possible Duplicate: How do I make a request using HTTP basic authentication with PHP

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.