0

I am developing a new website by using codeigniter and yesterday I hosted it on a new server. It's working perfectly with home page(landing page URL: http://(domain-name)/(folder-name)). But, if I try to access any other page, it shows:

404 Not Found error "The requested URL /(folder-name)/ Register was not found on this server."

URL: http://(domain-name)/(folder-name)/Register

I am using routes.php so,

Register =

$route['Register'] = 'register/index';

I already changed index.php to

$config['index_page'] = '';

and changed

$config['uri_protocol'] = 'AUTO';

and my .htaccess is

RewriteEngine on  
RewriteCond $1 !^(index\.php|public|\.txt)   
RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME} !-d  
RewriteRule ^(.*)$ folder-name/index.php?$1 [L]  

Please help me to solve this issue. Thanks and Regards

3
  • which version of CI are you using? Commented Feb 9, 2016 at 9:24
  • my CI version is 2.2.0 Commented Feb 9, 2016 at 9:27
  • Starting version 3.X, Codeigniter strictly checks for filenames. All the class names (controller and model) and pertaining files should be strictly named in Ucfirst! Make sure you have done that. You won't get such errors in mac, because the file system is case insesitive but linux throws up! Try changing file names according to the strict conventions Commented Feb 9, 2016 at 9:33

2 Answers 2

1

Try below lines by clearing your .htaccess.

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php?/$0 [QSA,L]
</IfModule>

It worked for me. Hope so will solve your problem as well.

Sign up to request clarification or add additional context in comments.

Comments

0

Try to edit the htaccess file using the following link

http://addictors.in/remove-index-php-from-url-in-codeigniter/

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.