htaccess codeigniter in subfolder

i have codeigniter in subfolder, the url is

http://192.168.0.80/suropati-dashboard/index.php/login

remove index.php so i get url

http://192.168.0.80/suropati-dashboard/login

but it stuck with .htaccess config, this how to solve

server using ubuntu server 15.10

first create dir for logs, this is optional, i using this folder to file log file

mkdir -p /var/www/logs

second edit /etc/apache2/sites-available/000-default.conf

<VirtualHost *:80>
        ServerAdmin g3n1k@x230
        DocumentRoot /var/www/html/
        <Directory />
                Options Indexes FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /var/www/html/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
        ErrorLog /var/www/logs/error_log
        CustomLog /var/www/logs/custom_log combined
        RewriteEngine On
</VirtualHost>

third edit .htaccess in sub folder /var/www/html/suropati-dashboard/.htaccess

RewriteEngine On
RewriteBase /suropati-dashboard/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

last restart service apache2

sudo service apache2 restart

Published by

G3n1k

just to remember what i had known :)

One thought on “htaccess codeigniter in subfolder”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s