0

Ive seen a similar question on here about this problem, but as it didn't resolve my issue, I have to write another.

I've moved a client's site from my own testing server to their previously bought site hosters lcn.com. While the homepage http://mydomain.com loads absolutely fine, any sub-page (http://mydomain.com/page) gives me the "No input file selected" error.

It must be an htaccess/server set up issue, although lcn have told me mod rewrite is all on, and nothing should be restricted. If I visit the subpages the plain way, http://mydomain.com/index.php/page, they load fine.

So, here goes, here's my htaccess file. Any thought as to why I have problems?

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>

ErrorDocument 404 /index.php
</IfModule>
Michael Watson
  • 1,079
  • 3
  • 14
  • 26
  • I would look at RewriteBase, could be that it should be something like `/webhost/globalroot/mydomain/` – danneth Aug 23 '11 at 11:29
  • I've never included the document_path in a RewriteBase before - and on all hosting I've had encounters with a simple / or subdirectory works fine for it. Just gave it a go anyway, and it 500s. – Michael Watson Aug 23 '11 at 11:39

1 Answers1

0

This is a thousand times question in the original forums(CI forums). And while above htaccess generally works to remove the index.php from your url, there are several additional config you need to check/try.

  1. Your htaccess.

    # RewriteRule ^(.*)$ index.php/$1 [L]
    # While above rule seems fine in general environment, sometime i need to modify that into
    RewriteRule ^.*$ index.php/$1 [L]
    
  2. Your config.php

    // $config['uri_protocol']  = 'AUTO';
    // In some environment, you need to change it
    // $config['uri_protocol']  = 'PATH_INFO';
    // or..
    $config['uri_protocol'] = 'REQUEST_URI';
    
toopay
  • 1,635
  • 11
  • 18
  • Hi toopay - thanks for your reply. I've actually tried everything I can find on the CI forums, and no change to the htaccess or uri protocol settings have helped. Your two suggestions here do not resolve this problem. Do you have any other ideas? – Michael Watson Aug 23 '11 at 12:12
  • In some (weird) situation/environment, i need to add '?' in rewrite rule `RewriteRule ^(.*)$ index.php?/$1 [L]` – toopay Aug 23 '11 at 12:15
  • I gave this a go (and this is certainly a weird environment), and oddly all pages redirect to the homepage - is that strange? – Michael Watson Aug 23 '11 at 12:20
  • try change your uri protocol to `REQUEST_URI`, and try that with various htaccess given above... – toopay Aug 23 '11 at 12:26
  • You're awesome. REQUEST_URI + index.php?/$i (with the question mark) worked. Finally. What a waste of time that was! Thanks again. – Michael Watson Aug 23 '11 at 12:36