4

My codeigniter is installed in admin_new folder on hostinger and path of installed codeigniter is public_html/vishwa/admin_new/ and i am trying to remove index.php from url.

I have changed my .htaccess file as below.

RewriteEngine on
RewriteBase /vishwa/admin_new/
RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

I have checked forums and it says mode_rewrite is enabled as default on hostinger. but it is showing error like No input file specified.

I have also changed config settings in config.php as below:

$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

but still it is showing same error. Why this type of error has been shown and how can i solve it.

6
  • Have you set base_config to http://www.yourdomain.tld/vishwa/admin_new/? Also change this in .htaccess file RewriteRule ^(.*)$ index.php?/$1 [QSA,L] (note the question mark). Commented Sep 12, 2016 at 11:19
  • great. It removed the error. but when i got to url gurukrupa.tk/vishwa/admin_new/users it shows the gurukrupa.tk/vishwa/admin_new/users url in address baar. and other thing is it is not loading the css also. Commented Sep 12, 2016 at 11:35
  • Ok. When i removed '?' after admin_new it works fine. Commented Sep 12, 2016 at 11:38
  • Probably you are using relative paths and that way it depends on uri segments count. For css you should use something like <?php echo base_url('assets/css/style.css'); ?>. For JS files and images too. Commented Sep 12, 2016 at 11:50
  • got it. Thanks for your help. Commented Sep 12, 2016 at 12:06

1 Answer 1

3

try this

RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.