formmailer,

Originally Posted by
formmailer
I'll assume that you have mod_rewrite and .htaccess available to you -- otherwise, have a look at the article at datakoncepts.com/seo.
Quite obviously, the first thing that mod_rewrite has to do is to determine which virtual server is playing host (which it should do automatically). Then it needs to determine whether the {REQUEST_URI} is empty (blank) so that it can redirect to the appropriate domain's index (invisibly). Piece of cake!
Code:
RewriteEngine On
RewriteRule ^$ index_%{HTTP_HOST}.html [L]
If you really don't want the www. and .com in the %{HTTP_HOST} string, you'll need to create a rewrite condition to isolate just the (lowercase ONLY) domain name. The following should eliminate the www. and .com - you can change that if necessary:
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z]+)\.com$ [NC]
RewriteRule ^$ index_%2.html [L]
Ho-kay, that should do it (for your specific request). Don't forget, I charge
DOUBLE
if you change your request 'cause you really wanted something else!
Regards,
DK
Bookmarks