I'm using mod_write to rewrite this
www.variabledomain.variableext
to
http://my.com/variabledomain.variableext
Note that variabledomain
and variableext
are really variable, so I can't hardcode them.
I'm not an expert at mod_rewrite, but I thought something like would work, but it isn't. Any ideas what I should be doing instead.
RewriteRule ^(.*)\.(.*)\.(.*)$ http://my.com/$2\.$3 [R=301,L]
RewriteRule only matches on the URL path, not the hostname. You'll need to use RewriteCond, e.g.
There are more great examples on how to do similar things in the Apache documentation "Dynamic mass virtual hosts with mod_rewrite". Pay particular attention to the "See Also" section on the right that has great examples.