CodeIgniter icon indicating copy to clipboard operation
CodeIgniter copied to clipboard

space in base_url causes bug

Open RedDragonWebDesign opened this issue 3 years ago • 1 comments

When placing CI3 a couple folders down from the root, and one of those folders is multiple words separated by spaces, CI3 does not handle spaces in folder names in base_url well, and this causes it to misidentify the controller class and method.

Steps to reproduce

  • Windows 10
  • Get an Apache web server running (can use XAMPP)
  • Set the web server's base directory to somewhere.
  • Make the following folders in the web server's base directory: '/Folder 1/Folder2/Folder3'. Note the space in Folder 1.
  • Download latest CI3, place in Folder3.
  • Configure whatever variables needed to get CI3 mostly running. For example setting $config['base_url'] = 'http://localhost/Folder 1/Folder2/Folder3/'; or $config['base_url'] = 'http://localhost/Folder%201/Folder2/Folder3/';
  • Turn on the profiler
  • Visit http://localhost/Folder 1/Folder2/Folder3/index.php. CI will load but it will not load $route['default_controller'] like it's supposed to, it will load the 404 page instead.
  • Look at the class/method section of the profiler. Will say 'Folder%201/Folder2' instead of the correct controller class and method.

RedDragonWebDesign avatar Jun 22 '22 23:06 RedDragonWebDesign

Hi @RedDragonWebDesign , I don't think this is a problem, can you use vhosts to control them, or wrap them in a docker container?

nguyenanhung avatar Jan 08 '23 16:01 nguyenanhung