"Davide Bianchi" <davideyeahsure.RemoveThis@onlyforfun.net> schreef in bericht
news:2jr9c5F1452b9U6@uni-berlin.de...
> Andy <me.RemoveThis@privacy.net> wrote:
> > i have been told search enigines such as google may not like
> I don't see why they shouldn't like this and like instead the
> redirect. A server alias is perfectly transparent. Ok, it could lead
> the search engine to store multiple time the same page as coming from
> different servers while it's coming from one server only, but if you
> used the UseCanonicalName option then the URL will be rewritten and
> the server will react like a redirect without a redirect.
Personally, I dislike aliassing as it crums my cookies.
Some almost-in-use rewrites ...
# in server context enforce redirecting a serverless domain
# 'www' may vary per machine
RewriteCond %{HTTP_HOST} ^[^\.]+\.[^\.]+$
RewriteRule (.*) <a style='text-decoration: underline;' href="http://www.%" target="_blank">http://www.%</a>{HTTP_HOST}$1 [R=301,L,QSA]
# in the first <virtualhost ...> force redirecting a would-be-aliassed
domain
# _one_ vhost services and logs all redirects for any other vhost
RewriteMap lc int:tolower
RewriteRule ^/*(.*)$ /${lc:%{HTTP_HOST}|NONE}/$1 [QSA]
RewriteMap domain txt:/etc/apache2/domains.txt
RewriteRule ^/([^\.])+(\.[^\.]+\.[^/]+)/(.*) <a style='text-decoration: underline;' href="http://$1.$" target="_blank">http://$1.$</a>{domain:$2}/$3
[R=301,L,QSA]
Given OP's examples, domains.txt would read like
xxxxxertl.com xxxxxl.com
xxxxxrtl.com xxxxxl.com
xxxxx23l.com xxxxxl.com
HansH<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: 301 v alias