php - codeigniter 404 error -
ive started codeigniter site. default controller $route['default_controller'] = "login"; in routes.php
and base url $config['base_url'] = 'http://digimed.net/sandbox/'; in config.php
scenario type http://digimed.net/sandbox/ in teh url bar index method of login controller expected.
scenario b type http://digimed.net/sandbox/login 404 error when expected same result in scenario a.
in fact cannot access function in login controller. 404 error every time.
is there need change in routes or congig?
thanks
in case interested solved problem adding following .htaccess file in website route directory ( codeigniter route directory lives )
<ifmodule mod_rewrite.c> rewriteengine on rewritebase /system_admin #removes access system folder users. #additionally allow create system.php controller, #previously not have been possible. #'system' can replaced if have renamed system folder. rewritecond %{request_uri} ^system.* rewriterule ^(.*)$ /index.php/$1 [l] #checks see if user attempting access valid file, #such image or css document, if isn't true sends #request index.php rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d #this last condition enables access images , css folders, , robots.txt file #submitted michael radlmaier (mradlmaier) rewritecond $1 !^(index\.php|images|robots\.txt|css) rewriterule ^(.*)$ index.php/$1 [l] </ifmodule> <ifmodule !mod_rewrite.c> # if don't have mod_rewrite installed, 404's # can sent index.php, , works normal. # submitted by: elliothaughin errordocument 404 /index.php </ifmodule>
Comments
Post a Comment