Clayton,
The simplest way would be to move all your files into the DocumentRoot. Anything else just makes no sense.
Okay, other options:
1. Use an index.php file in the DocumentRoot with a link to the forum.
2. If you're indeed, refusing to use files in the DocumentRoot (except .htaccess), use something like:
Code:
RewriteEngine on
RewriteBase /forum
RewriteCond %{REQUEST_URI} !^/forum
RewriteRule .? /forum%{REQUEST_URI} [L]
As for your code:
Code:
RedirectMatch permanent ^/$ http://motonews.com/forum
Then
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.motonews.com [NC]
RewriteRule ^(.*)$ http://motonews.com/$1 [L,R=301]
RewriteRule ^/?$ "http\:\/\/motonews\.com\/forum" [R=301,L]
- I dislike using the RewriteBase directory because it can adversely affect redirections.
- You failed to escape the dot characters in your regex
tup: though for the No Case flag) - Capturing the {REQUEST_URI} with the
EVERYTHING
atom is a waste of server resources - Your regex states that you do not know whether you're using an Apache 1.x or Apache 2.x server but you want only the domain to have been requested. Clearly, that's NOT what you want. Then you've quoted and escaped EVERYTHING in the redirection (when quotes and escapes are never used); how silly is that?
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.
Regards,
DK
Bookmarks