Perplexed using codeigniter on a shared hosting server

This is new to me. I am transferring the site that I made in codeigniter to the godaddy hosting site server. I can go to the homepage:

http://www.example.com 

But when I try to go to other pages, for example:

 http://www.example.com/about-us/ 

It gives me this error message:

Not found

The requested URL / example / index.php / about-us / was not found on this server.

In addition, when trying to use ErrorDocument to process a request, a 404 Not Found error was detected.

If I use:

 http://www.example.com/index.php/about-us/ 

The page looks as clear as day.

I was looking for a way to bypass CI, but my site has more static pages and then dynamic pages.

All in all, my question is what am I doing wrong and does this have anything to do with having a godaddy hosting account?

.htaccess

 RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

CI configuration file

 $config['base_url'] = ''; $config['index_page'] = ''; $config['uri_protocol'] = 'QUERY_STRING'; 

CI startup file

 $autoload['helper'] = array('url'); 

Update from 09-30-2011:

In .htaccess use:

 # Options Options -Multiviews Options +FollowSymLinks #Enable mod rewrite RewriteEngine On #the location of the root of your site #if writing for subdirectories, you would enter /subdirectory RewriteBase / #Removes access to CodeIgniter system folder by users. #Additionally this will allow you to create a System.php controller, #previously this would not have been possible. #'system' can be replaced if you have renamed your system folder. RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] #Checks to see if the user is attempting to access a valid file, #such as an image or css document, if this isn't true it sends the #request to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d #This last condition enables access to the images and css #folders, and the robots.txt file RewriteCond $1 !^(index\.php|images|robots\.txt|css) RewriteRule ^(.*)$ index.php?/$1 [L] 

In the CI configuration file:

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

Source: codeigniter.com/wiki/Godaddy_Installaton_Tips

+4
source share
3 answers

This is a .htaccess problem. Try modifying the .htaccess file:

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

Your updated .htaccess is right. you need a little change in it. change the line below in the .htaccess file:

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

and in config.php

 $config['uri_protocol'] = 'QUERY_STRING'; 
+4
source

This is not a godaddy solution, but the same error on my local WAMP host ...

I had a simple fix that started after updating my WAMPserver. He set up a new apache configuration and turned off rewrite_module mode.

To fix, I just left the wamperver icon click-> Apache-> Apache Modules-> rewrite_module and make sure it is checked.

+1
source

All Articles