0

htaccess code :

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

config file :

$config['base_url'] = 'http://baseurl/apps';
    $config['index_page'] = '';
    $config['uri_protocol'] = 'AUTO';
    $config['enable_hooks'] = FALSE;
    $config['allow_get_array']      = TRUE;
    $config['enable_query_strings'] = FALSE;

I am getting "404 page not found " error coming. when i changed htaccess file

  RewriteRule ^(.*)$ index.php?/$1 [L]  to   RewriteRule ^(.*)$ index.php/$1 [L]

"no input file specifed" error arise.

I have tried several htaccess codes,but still i am getting these issues.

I am using above htaccess codes , for removing index.php from the url.

2 Answers2

0

Can't use comments yet, so am using the answer box then. You might want to take a look at this question, which got solved and seems like it's almost exactly the same as your issue: CodeIgniter htaccess and URL rewrite issues

edit: If you're using nginx or another webserver, please bear in mind that .htaccess files are not supported on these servers. I too sometimes get 'file input not specified' errors in nginx with some applications. Mostly it is, because those servers don't support .htaccess files. So, please be sure you're using Apache.

Community
  • 1
  • 1
Wcool
  • 329
  • 1
  • 2
  • 9
  • Already posted by @Dexa, you might try the RewriteBase then, as the index.php is under a folder from the root (apps). Also check your config base_url, there you can see that under the URL, is a subfolder apps. Otherwise Apache will look for it in the root '/' instead of '/apps'. Hope this helps. – Wcool Apr 15 '14 at 14:00
0

Try setting

RewriteBase /apps/

in your .htaccess file

In general I use this htaccess, and it never let me down:

     <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /

        #Removes access to the system folder by users.
        #Additionally this will allow you to create a System.php controller,
        #previously this would not have 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>
Dexa
  • 1,641
  • 10
  • 25