tm,
The FIRST thing to learn about mod_rewrite is when NOT to use it. Since mod_alias handles your specific task very nicely, that's what I'd use:
Code:
Redirect 301 / /subfolder/
Since that looks like it would be "loopy," you could fall back on mod_rewrite:
Code:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^subfolder/
RewriteRule .? subfolder%{REQUEST_URI} [R=301,L]
There's just too much wrong with your attempt to cover ... and I've addressed exactly those issues many times in many threads. Therefore, you might benefit from reading the mod_rewrite tutorial linked in my signature as it contains explanations and sample code. It's helped may members and should help you, too
Of course, the REAL answer is simply to move the contents of subfolder into the DocumentRoot and delete the subfolder. Alternatively, simply redefine your DocumentRoot to the location of the subfolder.
Regards,
DK
Bookmarks