php - CodeIgniter Mod_Rewrite Issue - URL's only showing index -
i have ci app after switching servers, doesn't seem route properly.
in config have
$config['uri_protocol'] = "path_info"; $config['enable_query_strings'] = true;
this should allow both query string parameters , url segments.
so this, should in theory work (as on old server):
http://www.domain.com/register?param=something
however, no matter url go shows index.
so if go http://www.domain.com/register
it shows in address bar, doesn't register controller, it's showing index.
if change 'uri_protocol' request_uri, works. query string parameters won't.
my .htaccess is
directoryindex index.php rewriteengine on rewritecond $1 !^(index\.php|assets|robots\.txt|favicon\.ico|license.txt) rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ ./index.php/$1 [l,qsa] rewritecond %{query_string} . rewriterule ^$ /? [l]
any ideas issue be? say, it's working on different server. so, i'm thinking apache perhaps?
thanks lot!
i'd guess, rewritecond $1
never evaluates true , no redirect happens.
you can, actually, reduce these 2 lines one:
rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d
it's sufficient write
rewritecond %{request_filename} !-f
since -f
test checks files and directories. if still fails produce expected results, inspect path_info
, orig_path_info
in $_server
if they're present.
Comments
Post a Comment