[..] I would like to redirect them to some specific .html when hitting home.
A language like PHP is better suited for redirecting a single page.
The following code will redirect http://example.com/
to http://example.com/example.html
and http://example.org/
to http://example.org/anotherpage.html
. http://www.example.com
will be unaffected (note the www.
part)
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^$ example.html [R]
RewriteCond %{HTTP_HOST} ^example.org$ [NC]
RewriteRule ^$ anotherpage.html [R]
The first line matches the HTTP Host field (a.k.a. 'domain') against example.com
case-insensitive (^
marks the beginning of the string, $
marks the end).
If there is a match, the page will be redirected (second line, [R]
) to example.html
The same story for the third and fourth lines.