apache2 – configure mod_rewrite in virtual host

if you made virtualhost in apache and want remove file index.php from url with .htaccess and still cannot work

just add the .htaccess config to virtualhost config

ub@ubnew:/etc/apache2/conf-enabled$ ls
...       vhost.conf ...

ub@ubnew:/etc/apache2/conf-enabled$ cat vhost.conf
<VirtualHost *:80>
DocumentRoot "/media/sf_websocket/conektp"
ServerName conektp
 <Directory "/media/sf_websocket/conektp">
    RewriteEngine On
    RewriteBase /

    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]


Published by


just to remember what i had known :)

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