Assume `/` is the document root of my domain `example.com`.

`/.htaccess`
------------

```
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

```

`/dir/.htaccess`
----------------

```
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /dir/index.php [L]
</IfModule>

```

I know how to redirect `example.com/dir` to `www.example.com/dir`, because `/.htaccess` does the very job.

However, the trick here is that I have to keep `/dir/.htaccess` to serve up virtual directories (such as `/dir/state/AK/35827/` which aren't actual directories) if you know what I mean.

Problem is, if I keep `/dir/.htaccess`, a request of:

```
http://example.com/dir/state/AK/35827/

```

DOES NOT redirect to:

```
http://www.example.com/dir/state/AK/35827/

```

as would:

```
http://example.com/

```

redirect to:

```
http://www.example.com/

```

Not sure if I made it clear. 

Basically, how to make `http://example.com/dir/state/AK/35827/` correctly redirect to `http://www.example.com/dir/state/AK/35827/` AND I can serve virtual URLs?