How to Fix “htaccess: Options not allowed here” Error

By | May 1, 2023

Sometimes when you are adding directives to the htaccess file you get errors. Once such error is

htaccess: Options not allowed here

It occurs when using the Options directive like this

Options -Indexes

The error basically indicates that the htaccess file is not allowed to use the Options directive to change the settings.
To fix this edit the apache configuration file, which is located at

/etc/apache2/sites-enabled/000-default
$ gksudo gedit /etc/apache2/sites-enabled/000-default

Look out for directory tag for /var/www and add "Options" to the AllowOverride list. It should looks like this

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

Adding "Options" to the AllowOverride list, will permit the use of Options directive in htaccess file.
This will fix the error.

References

http://httpd.apache.org/docs/current/mod/core.html#allowoverride
About Silver Moon

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected].

Leave a Reply

Your email address will not be published. Required fields are marked *