views:

571

answers:

7

Anybody came into this before?

Hosting a site on godaddy, the site is developed in codeigniter framework(php), to get pretty url, put this into .htacess

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

problem is only domain.com/index.php seems to work, other urls e.g domain.com/user/login won't work, codeigniter always returns '404 page'.

Is there anything going on with godaddy's mod_rewrite or just their apache which as I know is version 1.3.

Any clue?

[update] a bit CI debug, found /system/libraries/Router.php line 239, line

show_404( $segments[0] ); always gets invoded.

$segments [ 0=>'index.php' ], that seems to be the problem, but why? All works on my dev box which is in apache2

A: 

Maybe godaddy doesn't allow the use of .htaccess files. I struggled with the pretty CI URLs for awhile on my local server, and eventually found that I had missed the AllowOverride property for my site in my server config.

http://stackoverflow.com/questions/1397014/how-do-i-write-a-htaccess-file-to-make-codeigniters-url-routing-work

Carson Myers
I'm sure godaddy support .htaccess, I was testing on it just don't know how to get it to work with Codeigniter.
Shawn
Well, that's all I got. I haven't dug into CI very much yet, but as a first PHP-framework experience, I found the pretty URL's part to be an all-around pain.
Carson Myers
godaddy does support .htaccess
mrinject
A: 

Try adding:

Options +FollowSymlinks

Above:

RewriteEngine on
mrinject
A: 

This Will Help You ...

http://www.amitgupta.me/?p=17&cpage=1

harman
A: 

Did you check your app's config/config.php file and set the index_page to an empty string?

$config['index_page'] = "";

You also may need to change your uri_protocol to something other than "AUTO"

$config['uri_protocol'] = "REQUEST_URI";
Funkatron
A: 

sfa asf asf asasf asfasfasf asasf

safs
A: 

try removing the / before the word index in your regex. "Long shot".. but it fixed a similar problem I had.

dryprogrammers
A: 

Had the same issue; Try this:

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