Enabling .htaccess in opensuse 11.1

By default .htaccess files will have no effect in opensuse 11.1 out of the box. In order to enable a .htaccess file, you must allow your web root directory to override controls. To do this navigate to your apache directory. For me it is:

cd /etc/apache2

Find the file named default-server-conf. Open it with your favorite text editor

nano default-server.conf

Find the line

<Directory "/srv/www/htdocs">

Everything between the directory tags will help you manage your web root of your server, in my case it is /srv/www/htdocs. The line you are looking for is

AllowOverride None

Change “None” to “All”. Your .htaccess files can now override directives set in your httpd.conf, default-server.conf, and php.ini files, among others. This will enable .htaccess to do things like limit viewing of .inc, .sql, .log, and .ini files by putting

<Files ~ "\.(inc|sql|log|ini)$">
  order allow,deny
  deny from all
</Files>

in your .htaccess file.

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">