php - Deploying codeigniter on heroku works fine on localhost but path issues on heroku -


i deploying simple site on heroku make in codeigniter. works fine on localhost (xampp), not on heroku. on heroku requires index.php , says unable load model 'core' , case sensitive too. should do?

when run

http://localhost/herokuroot/

my page loads when run

https://bugdevroots.herokuapp.com/

it says

404 page not found  page requested not found. 

but works for

https://bugdevroots.herokuapp.com/index.php/welcome

and default controller welcome

i have included in .htaccess

<ifmodule mod_rewrite.c>     rewriteengine on         rewritecond %{request_filename} !-f         rewritecond %{request_filename} !-d         rewriterule ^(.*)$ index.php?/$1 [qsa,l] </ifmodule> <ifmodule !mod_rewrite.c>         errordocument 404 index.php </ifmodule> 

and in config.php

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

i have same problem , how solved far.

first, inside routes.php have set pages

$route['default_controller'] = 'pages/view'; $route['(:any)'] = 'pages/view/$1'; 

assuming inside views folder have folder called pages contains pages in site. after adding in routes.php go autoload.php inside config folder , set following codes:

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

and set following codes config.php inside config folder

$config['base_url'] = 'your_heroku_link'; $config['index_page'] = 'views/pages/home.php'; $config['uri_protocol'] = 'request_uri'; $config['sess_save_path'] = sys_get_temp_dir(); 

in index_page' file path of pages stored , home.php page go once loaded.

having set of push on heroku

$ git push heroku master 

and open app see results

$ heroku open 

this might not right answer since still fixing on loading css files in app. can check out codes on github if need references: https://github.com/oarikirian/fy-stories-inc


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -