# Help Testing mod_rewrite on apache 2.4

## turtles

Greetings all I am testing out mod_rewrite on apache 2.4

I have a directory called test in htdocs.

I have 2 files index.html 

And rewriteme.html

my rewrite rule is:

```

Alias /test /var/www/localhost/htdocs/test/

<Directory test>

  RewriteEngine On

  RewriteRule ^/test/?$ /test/rewriteme.html [R]

  #RewriteRule ^/test/* /test/rewriteme.html [R]

  # Next test the HTTP Authorization data should be passed

  # to the CGI scripts running from this directory

  #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

</Directory>
```

Which I think says anything I try to go to in test will redirect me to  test/rewriteme.html

however when I go to localhost/test I can see index.html's contents.

Any thoughts?

EDIT: I don't have to put anything special in /etc/conf.d/apache2 do I ?

----------

## turtles

Fixed it. Funny apache bug mod_rewrite can not use an alias.

Something like this should be a good test if you have mod_rewrite working.

 *Quote:*   

> #DocumentRoot /var/www/localhost/htdocs/test
> 
> Alias /test /var/www/localhost/htdocs/test
> 
> <Directory /var/www/localhost/htdocs/test/>
> ...

 

Got my answer here:

http://unix.stackexchange.com/questions/93460/how-to-configure-mod-rewrite-with-an-alias-in-apache-2-4

----------

