0

Let me inform you this first. This application is working pretty fine on live server currently, however we needed to move it to a different server with a different domain.

Issue is: It gives 404 error on every other page except for index. Loading through index.php works fine.

For an example:

www.test.com/main/login //This gives 404 error

www.test.com/main/index.php/login //This loads fine

Because everything is working fine currently, I made changes only in $config['base_url'] and in database config file. There have been no other changes in any of the files.

Also, this solution provided by somebody in a different questions is already tried out and this doesn't work. Solution is to create .htaccess file with below code & setting $config['index_page']='' :

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

Current server is VPS & provider is GoDaddy. New server is Shared hosting and provider is GoDaddy. I'm not getting the root cause of this happening, can somebody point out to the possible solution?

EDIT

I'm attaching a screenshot for an error, it's not typical 404 error page. In case this helps.

enter image description here

Guy in the chair
  • 1,045
  • 1
  • 13
  • 42
  • 1
    Possible duplicate of [CodeIgniter removing index.php from url](https://stackoverflow.com/questions/19183311/codeigniter-removing-index-php-from-url) – Artier Dec 04 '17 at 20:06

1 Answers1

1

For Godaddy, you need to alter this 2 things.

In your .htaccess file, replace

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

With the following:

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

Then is your application/config/config.php :

$config['index_page'] = '';

Both this changes should help you resolve your issue.

Blakdronzer
  • 300
  • 3
  • 13