1
votes

I've confused using ubuntu for setting up virtual host for CI in apache2.

I have website for running in locally using virtual host, but when I open my navigation link like.

mysite.com/about_us

It can't be open, and said : 404 Not Found

This is my virtual host code

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName blade.co.loc
    ServerAlias www.blade.co.loc

    DocumentRoot /var/www/html/new/

    <Directory /var/www/html/new/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

And this is my .htaccess code

<IfModule mod_rewrite.c>
Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine On
RewriteBase /new/

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
1

1 Answers

0
votes

Follow this steps. It will lead you in correct path. It has describe every details. And also check you have correctly given the link in routes.php. This is for creating virtual host in ubuntu https://support.rackspace.com/how-to/set-up-apache-virtual-hosts-on-ubuntu/