0

Recently, I have hosted a website using godaddy. When I enter the domain name in url first page is loading without error, Now when I click on any link or button on the first page[home page], it is giving 404: file not found error.

EDIT: .htaccess file from root folder:

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase / 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 
php_value upload_max_filesize 200M 
php_value post_max_size 200M 
php_value max_input_time 3600 
php_value max_execution_time 3600
  • **404 : File/Location Not Found** – Hamza Abdaoui Mar 09 '18 at 08:22
  • Check the location where your buttons redirect! Are they link to the correct files in the correct path? – Hamza Abdaoui Mar 09 '18 at 08:25
  • 1
    Yes, It is the .htaccess problem. Post your .htaccess file here to check the issue. – Ashok Mar 09 '18 at 08:26
  • RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] php_value upload_max_filesize 200M php_value post_max_size 200M php_value max_input_time 3600 php_value max_execution_time 3600 – raviraj chandike Mar 09 '18 at 08:36
  • 1
    please add that to your question and check [this link](https://stackoverflow.com/questions/17676920/codeigniter-showing-only-default-controller) – Jigar Shah Mar 09 '18 at 08:37
  • "something" is not very informative. Please state what error you are getting. And what do you mean "not taking"? – jtheman Mar 09 '18 at 08:45
  • How is `$config['base_url']`set in your config? And can you add the location URL that buttons point to, as @HamzaAbdaoui asks above. – jtheman Mar 09 '18 at 09:22

1 Answers1

0

you can try this code:

upload htaccess file in your root floder

<IfModule mod_rewrite.c>

    RewriteEngine On
    RewriteBase /
    Options -Indexes

    RewriteCond %{REQUEST_URI} ^system.*

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

    RewriteCond %{REQUEST_URI} ^application.*

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

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

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

</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php

</IfModule>
  • it should be in root directory if you have uploaded it, otherwise create new file and try the above answer or from [this link](https://stackoverflow.com/questions/17676920/codeigniter-showing-only-default-controller) – Jigar Shah Mar 09 '18 at 08:55
  • This version of `.htaccess` adds some security but no real change to the issue that Raviraj experiences. Is `mod_rewrite` enabled on the server? – jtheman Mar 09 '18 at 09:20
  • Thank you for your help -shabbirhasan nandoliya – raviraj chandike Apr 17 '18 at 07:49