Welcome Guest, Not a member yet? Register   Sign In
Configure website not on the site root, eg https://website.org/ci4/
#1

Hello there,
I'm start learning Codeigniter framework and have some issues while testing website placed not as primary web, but in sub directory, eg https://website.org/ci4/
It is not clear to me how to proper make a configuration to address locale and routes. For example:

in ".env"
Code:
app.baseURL = 'https://website.org/ci4/'

in "app/Config/Routes.php"
PHP Code:
$routes->get'{locale}/test''Home::test' ); 


when accessing website using "en" locale, "https://website.org/ci4/en/test" I'm getting 404 error:
Code:
Can't find a route for 'get: ci4/en/test'.

Also I'm getting 404 error on "__hot-reload"

Code:
Can't find a route for 'get: ci4/__hot-reload'.



Thanks in advance
Reply
#2

Ok, I guess I found my issue in ".htaccess"
Code:
Code:
# If you installed CodeIgniter in a subfolder, you will need to       
# change the following line to match the subfolder you need.         
# http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
RewriteBase /ci4                                                     
Thanks!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB