views:

98

answers:

1

I'm trying to use Codeigniter OpenID library (http://codeigniter.com/wiki/OpenID/) and everythyng work fine with default configuration of ci without .htaccess. When I remove index.php by changing config.php and .htaccess I get 404 Page Not Found when I try to verify my openid (http://ci.dlsb.eu/test/)

Can anybody tell me where I'm wrong.

config.php

$config['index_page'] = "";

.htaccess

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

Your RewriteRule attempts to create PATH_INFO in a per-directory context, which, from what I can tell, occurs too late in the request processing phase to work correctly.

The best solution is to simply not do this, as CodeIgniter doesn't require it to function:

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

CodeIgniter should be able to figure out what the proper request was on its own, provided that you left $config['uri_protocol'] set to AUTO. If not, you should set it to either AUTO or to REQUEST_URI.

Tim Stone
Ok, i fixed my .htaccess, $config['uri_protocol'] is set to REQUEST_URI, but I still get the same error...
Vasil Dakov
Yeah, I may have been a little off-base. It's because the URL the form submits to doesn't have a trailing slash, so CodeIgniter's routing is failing somehow. I'll check to see why that might be and let you know how you can fix it.
Tim Stone
When I set $config['url_suffix'] = "/"; everything work fine. Thanks Tim!
Vasil Dakov
Ah, good stuff. Glad it's working!
Tim Stone