Category Archives: htaccess

How to enable use of .htaccess

First Step
Open file as
sudo vim /etc/apache2/apache2.conf

Second Step
remove comment sign (#) if you find it before this line ( line number 187 approx.)
AccessFileName .htaccess

Third Step
Then find the line where there is

<Directory /var/www/>
Options Indexes FollowSymLinks
Require all granted

replace “None” with “All”
AllowOverride All

sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart


Rujukan : –¬†

Edit pada fail .htaccess

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?:// [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]