php - Codeigniter vhost LAMP configuration troubleshoot -
running lamp on ubuntu 14lts on virtualbox win7 found hiccups.
i'm having trouble displaying code igniter project in machine. have followed guides including one: tut 1 , tut 2
i can make current configuration show single html page, called example.com cannot show complete code igniter project, error when running through localhost:
not found requested url /alpa_blog/en not found on server.
the project i'm working on big bitnami bitslow i'm planning change lamp why wanted try , see little blog on localhost. have not used lamp on apache 2.4+ i'm little confuse how edit files on vhost , tie them config.php inside code igniter.
i've tried lot of different combination things no success yet. have files @:
/etc/apache2/sites-available/alpa_blog.com.conf /etc/apache2/sites-enabled/alpa_blog.com.conf
looking like:
<virtualhost *:80> servername alpa_blog.com serveralias www.alpa_blog.com documentroot /var/www/html/alpa_blog.com/application errorlog ${apache_log_dir}/error.log customlog ${apache_log_dir}/access.log combined </virtualhost>
and @ /etc/apache2/sites-available/000-default.conf
looks like:
<virtualhost *:80> serveradmin webmaster@localhost documentroot /var/www/html/ errorlog ${apache_log_dir}/error.log customlog ${apache_log_dir}/access.log combined </virtualhost> <directory /var/www/html> options indexes followsymlinks multiviews allowoverride </directory>
plus file alpa_blog.com/config/config.php
code igniter's folder looks like:
$config['base_url'] = 'alpa_blog.com';
my etc/hosts
folder looks like:
127.0.0.1 localhost 127.0.1.1 alpalamp-virtualbox 127.0.1.1 example.com localhost 127.0.1.1 alpa_blog.com localhost
my var/www/html
folder looks like:
alpa_blog.com ci example.com index.html phpinfo.php
any pointers appreciated. sorry supposed know question, it's driving me nuts.
edit: i've tried several configurations on .htaccess
file. last version of .htaccess
:
rewriteengine on rewritecond %{http_host} !^$ rewritecond %{http_host} !^www\. [nc] rewritecond %{https}s ^on(s)| rewriterule ^ http%1://www.%{http_host}%{request_uri} [r=301,l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l]
and config.php like: $config['index_page'] = '';
so after while found answer, thought post here in case.
going in log file located @ var/log/apache2/error.log
found message:
[core:alert] [...] /var/www/html/app-name/www/.htaccess: rewriterule: bad flag delimiters
, turns out regex expression not written.
i ended rewriting rule on .htaccess
file this:
rewriteengine on rewritecond $1 !^(index\.php|images|assets|uploads|robots\.txt) rewriterule ^(.*)$ /index.php/ [l]
which solved issue.