codeigniter 3.1.9 with apache and php 7.2 - routing/redirect issues with sym link |
SCENERIO:
Recently I migrated CodeIgniter from 2.4 to 3.1.9 along with PHP from 5.2 to 7.2. Also, created a new httpd.conf file in apache. When I go to the site's URL, it loads the default page fine and I can browse to default or root pages without any issues. There are multiple sub-domains that are mapped in routes.php to the main httpd root directory /var/www/html. These sub-domains have a symbolic link to /var/www/html, and within assets folder are the customization files for each sub-domains. Root HTTPD directory "/var/www/html" structure application assets test1 -> /var/www/html test2 -> /var/www/html index.php system URL is set as follows in config.php. $config['base_url'] = 'https://example.com/'; Below is my entry in routes.php: $route['default_controller'] = "home"; $route['404_override'] = ''; $route['home'] = "home"; $route['select-product'] = "home/select-product"; $route['test1/select-product'] = "home/select-product"; $route['test2/select-product'] = "home/select-product"; Below is httpd.conf file for the <Directory> # Relax access to content within /var/www. # <Directory "/var/www"> AllowOverride None Require all granted </Directory> # Further relax access to the default document root: <Directory "/var/www/html"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> PROBLEM: When I browse to https://example.com/ it loads everything correctly. When I go to https://example.com/test1 ==> First page loads correctly. But when I press next, the second page defaults back to 'https://example.com/';. Somehow, it looses /test1 from the browser. Not sure if this is caused by CodeIgniter URL routing issue or something to do with httpd.conf file of Apache. The same routes.php file was working fine on the old server. The routing/pagination seems to have broken after I set $config['base_url'] = 'https://example.com/';. If left empty, it takes a while for the site to load, and when it does the forms and images are not loaded correctly. I have spent lots of hours trying to figure out the problem. I am hoping someone genius out there will be able to show be in the right direction. Thank you. |
Welcome Guest, Not a member yet? Register Sign In |