title: How to setup .htaccess In Codeigniter on Ubuntu 14.04 Lamp Stack Server
body: <p>I have no idea how to proceed, I checked many tutorial did step by step but no success, I started think it is something on my apache not running well.</p>
  
  <p>I am not the server person and always I get stuck in that stuff, my site its running well on my local but after transfer it to a server, the problems start.</p>
  
  <p>If you can help me, I will appreciate it.</p>
  
  <pre><code>/etc/apache2/sites-available
  mysite.com.conf
  </code></pre>
  
   
  
  <pre><code>   # domain: mysite.com
      # public: /var/www/mysite.com/public_html/
  
      &lt;VirtualHost *:80&gt;
      #error 403
          &lt;Directory "/var/www/mysite.com/public_html/blog"&gt;
              Options FollowSymLinks
              Require all granted
              AllowOverride None
              Require all granted
              Options Indexes FollowSymLinks MultiViews
              AllowOverride None
              Order allow,deny
              allow from all
              &lt;IfModule mod_rewrite.c&gt;
                RewriteEngine On
                RewriteBase /blog/
                RewriteRule ^index\.php$ - [L]
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteRule . /blog/index.php [L]
              &lt;/IfModule&gt;
          &lt;/Directory&gt;
  
           &lt;Directory "/var/www/mysite.com/public_html/"&gt;
              Options FollowSymLinks
              Require all granted
              AllowOverride All
              Require all granted
              Options Indexes FollowSymLinks MultiViews
              AllowOverride None
              Order allow,deny
              allow from all
          &lt;/Directory&gt;
  
          &lt;Directory /var/www/&gt;
                      Options Indexes FollowSymLinks MultiViews
                      AllowOverride All
                      Order allow,deny
                      allow from all
          &lt;/Directory&gt;
  
        # Index file and Document Root (where the public files are located)
        DirectoryIndex index.html index.php
        DocumentRoot /var/www/mysite.com/public_html
        # Log file locations
        LogLevel warn
        ErrorLog  /var/www/mysite.com/log/error.log
        CustomLog /var/www/mysite.com/log/access.log combined
      &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>/etc/apache2/sites-available</p>
  
  <p>000-default.conf</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      # The ServerName directive sets the request scheme, hostname and port that
      # the server uses to identify itself. This is used when creating
      # redirection URLs. In the context of virtual hosts, the ServerName
      # specifies what hostname must appear in the request's Host: header to
      # match this virtual host. For the default virtual host (this file) this
      # value is not decisive as it is used as a last resort host regardless.
      # However, you must set it for any further virtual host explicitly.
      #ServerName www.example.com
  
      ServerAdmin webmaster@localhost
      DocumentRoot /var/www/html
      DocumentRoot /var/www/mysite
  #for the error 403
  
      # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
      # error, crit, alert, emerg.
      # It is also possible to configure the loglevel for particular
      # modules, e.g.
      #LogLevel info ssl:warn
  
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
  
      # For most configuration files from conf-available/, which are
      # enabled or disabled at a global level, it is possible to
      # include a line for only one particular virtual host. For example the
      # following line enables the CGI configuration for this host only
      # after it has been globally disabled with "a2disconf".
      #Include conf-available/serve-cgi-bin.conf
  &lt;/VirtualHost&gt;
  
  # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
  </code></pre>
  
  <p>/etc/apache2
  apache2.conf</p>
  
  <pre><code>&lt;Directory /var/www/&gt;
      Options Indexes FollowSymLinks
      AllowOverride All
      Require all granted
  &lt;/Directory&gt;
  </code></pre>
  
  <p>application/config/config.php</p>
  
  <pre><code>$config['base_url'] = '';
  $config['index_page'] = '';
  </code></pre>
  
  <p>.htaccess file in my root</p>
  
  <pre><code> RewriteEngine on
     RewriteCond $1 !^(index\.php|assets|robots\.txt)
     RewriteRule ^(.*)$ index.php?/$1 [L]
  </code></pre>