# Apache rewriting

## rsala

Is gentoo's apache2 server set up enables for rewriting by default?  If not, could someone please provide, or point me to a simple how-to that will show me how to enable rewriting on a fresh plain vanilla apache2 install?

----------

## msalerno

http://www.gentoo.org/proj/en/apache/doc/upgrading.xml

You need to enable it in APACHE2_MODULES in your /etc/make.conf

Then you will probably need to enable it in /etc/conf.d/apache2

----------

## rsala

Thanks, I should have been more specific.  I added the debug flag in  /etc/conf.d/apache2 

```

APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PHP5 -e debug"

```

The output on a start seems to indicate that the rewriting module gets loaded

```

[Fri Apr 01 17:33:23 2011] [debug] mod_so.c(246): loaded module rewrite_module

```

I've read conflicting posts regarding which apache config files have to be set up to allow the .htaccess file to work and I was wondering if some one who has it working could show me which files they changed and how.

----------

## msalerno

Not sure how you went from mod_rewrite to access control, but here goes.  The posts are you are reading are probably not conflicting, they are most likely just specific to that persons configuration.  You should read up on the AllowOverride directive.

AllowOverride Directive

http://httpd.apache.org/docs/current/mod/core.html

----------

