0

I am trying to install codeIgniter and I have copied all of codeIgniter files to a folder called /backend in http://www.mydomain.com.

Now, http://www.mydomain.com/backend/index.php shows the codeIgniter welcome page.

Then I created a main.php in the /backend/controller folder. But when I open http://www.mydomain.com/backend/index.php/main, it shows No input file specified.

After looking at this question, i pasted a .htaccess file with the following contents into the /backend folder.

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

But the page http://www.mydomain.com/backend/index.php/main still says No input file specified.

Why is the .htaccess not making any difference? I don't understand whats going on.

Community
  • 1
  • 1
Harish
  • 490
  • 2
  • 11
  • 19
  • It might be the mod_rewrite is not enabled on your server, or that AllowOverrides (i.e. enable .htaccess files) is not turned on. – Mike Brant Apr 15 '13 at 19:18
  • With that .htaccess file, you'd probably want your url to be in the form `mydomain.com/backend/main`. Since it's directing all requests for non-existent files to index.php, there's not point in directly requesting index.php – Sam Dufel Apr 15 '13 at 19:24
  • @MikeBrant mod_rewrite is enabled and the same .htaccess file carries out other redirects. – Harish Apr 15 '13 at 19:54
  • @SamDufel the url `mydomain.com/backend/main` shows a 404. – Harish Apr 15 '13 at 19:55
  • 2
    @blenderous - try switching either `RewriteBase` to `/backend` or changing the `RewriteRule` to `^(.*)$ backend/index.php?/$1 [L]` – Sam Dufel Apr 15 '13 at 20:17
  • Post your main.php so we can eliminate the possibility of an error in your class. Do you still have the welcome controller, if so what happens when you go to `mydomain.com/backend/index.php/welcome/index` – Jeemusu Apr 16 '13 at 03:10

1 Answers1

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

then browse to :

http://www.mydomain.com/backend/main

and not to:

http://www.mydomain.com/backend/index.php/main

be sure you removed index.php in config/config.php and you setted $config['uri_protocol'] = 'AUTO'; (try also other solutions here if still not working)

itsme
  • 48,972
  • 96
  • 224
  • 345