Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.htaccess Is Not working in Linux(Debian) Apache2

I am using apache2 (my dummy server) which is already install with my Debian. Every thing goes fine, but now the problem with my .htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

It's not working
I think its because of apache2 version which am I using & maybe problems with my code or something I have to config on my server

I want to redirect my url to main index page if its a wrong entry or unavailable

like image 819
VIKASH DASH Avatar asked Apr 01 '14 22:04

VIKASH DASH


1 Answers

After spending a whole day, I got my answer

In Folder
apache2>>sites-available>> There is file called default

In default we have to change it

From:

<Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

TO:

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

Its working. It's enabled use of .htaccess files.

like image 110
VIKASH DASH Avatar answered Sep 21 '22 19:09

VIKASH DASH