I am looking for an experienced CodeIgniter programmer who can help me get my work environment setup -- either via email or teamviewer. This could lead to additional work.
Codeigniter controller in subdirectory not working in virtual host
I need help with CodeIgniter -- trying to it to work in virtual host envirnoment in Ampps.
I have been following the following tutorial:
[login to view URL]
I am trying to have two installations of CodeIgniter running in two directories:
/students
/teachers
[login to view URL] -> goes to /teachers directory
[login to view URL] -> goes to /students directory
I have the above working on my local machine. The different URL's take me to the correct directory. CI works. Problem arises when I try to access controller using redirect.
if I try to redirect('error') I get:
[login to view URL]
Also get an "internal server error"
if I type in
[login to view URL]
I get an "internal server error"
if I type in
[login to view URL]
I get desired result
It works if I try to load view directly in
$this->load->view('error')
I think I need help with the urls and paths. Any guidance most gratefully received.
------------
Nothing particularly enlightening in CI log files
In Apache logs I find:
Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
Things I have changed:
-----------------
htaccess in root - changed rewrite base. Also takes out [login to view URL]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /students/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ [login to view URL]$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ [login to view URL]$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ [login to view URL]$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 [login to view URL]
</IfModule>
--------------------------
application/[login to view URL]
$config['base_url'] = $_SERVER['HTTP_HOST'];
As per tutorial. Needs to be dynamic.
------------------------
my Apache [login to view URL] file
NameVirtualHost [login to view URL]
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/Program Files/Ampps/www/teachers"
ServerName [login to view URL]
ServerAlias [login to view URL]
<Directory "C:/Program Files/Ampps/www/teachers">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/Program Files/Ampps/www/students"
ServerName [login to view URL]
ServerAlias *.[login to view URL]
<Directory "C:/Program Files/Ampps/www/students">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
---------------------------
[login to view URL] in root
kept as is. Things got worse when I tried to change these
$system_path = 'system';
$application_folder = 'application';
please let me know if you have prior experience with setting up a website like the one described. Also, for this small project my budget is around $50. This should take 15 minutes for someone with the right experience.