Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • how to remove index.php in codeigniter url

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 196
    Comment on it

    Hello Friends,

    When we are working on Codelgniter the URL in the browser appear with index.php generally, the URL appear like ::

    "http://localhost/codelgniter/index.php/app/setuser"

     

    and we would like to see this as

    "http://localhost/codelgniter/app/setuser" to make this change we need to please review the below changes.

     

    1) First we need to create a .htaccess file on the root of your folder and the code of this file as given below:

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

     

    2) After saving .htaccess file we need to open "codelgniter/application/config/config.php" and make the changes as below

    $config['index_page'] = 'index.php';
    
    // Should be replace with
    
    $config['index_page'] = '';

    Now you can run URL like http://localhost/codelgniter/app/setuser

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: