<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nicolas Kuttler &#187; lighttpd</title>
	<atom:link href="http://www.nicolaskuttler.de/tag/lighttpd/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nicolaskuttler.de</link>
	<description>IT Dienstleistungen, Saarbrücken</description>
	<lastBuildDate>Sat, 12 Jun 2010 21:42:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Alle subdomains zur Hauptdomäne weiterleiten</title>
		<link>http://www.nicolaskuttler.de/2009/10/22/alle-subdomains-zur-hauptdomane-weiterleiten/</link>
		<comments>http://www.nicolaskuttler.de/2009/10/22/alle-subdomains-zur-hauptdomane-weiterleiten/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 10:01:44 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Technik]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[duplicate content]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Suchmaschinenoptmierung]]></category>

		<guid isPermaLink="false">http://www.nicolaskuttler.de/?p=45</guid>
		<description><![CDATA[Den korrekten host für eine Webseite zu erzwingen ist keine offensichtliche Aufgabe. Ist es wirklich wichtig, ob man eine Webseite unter www.seite.de und seite.de erreichen kann? Ein Problem könnten Suchmaschinen sein, die eine der Seiten als sogenannten duplicate content werten. Ein anderes Problem kann auftauchen, wenn man cookies benutzt. Wenn man beim Einsatz der cookies [...]]]></description>
			<content:encoded><![CDATA[<p>Den korrekten host für eine Webseite zu erzwingen ist keine offensichtliche Aufgabe. Ist es wirklich wichtig, ob man eine Webseite unter <tt>www.seite.de</tt> und <tt>seite.de</tt> erreichen kann?<span id="more-45"></span></p>
<p>Ein Problem könnten Suchmaschinen sein, die eine der Seiten als sogenannten <strong>duplicate content</strong> werten. Ein anderes Problem kann auftauchen, wenn man <strong>cookies</strong> benutzt. Wenn man beim Einsatz der cookies nicht besonders aufmerksam ist werden die cookies der Domäne <tt>www.seite.de</tt> auf <tt>seite.de</tt> nicht erkannt. Dies kann zu einer Vielzahl von Problemen für die Besucher führen (siehe auch die <a href="http://cgi.netscape.com/newsref/std/cookie_spec.html">cookie Spezifikation</a>).</p>
<p>Es gibt einige Lösungsansätze, darunter welche die <tt>mod_rewrite</tt> einsezten. <tt>mod_rewrite</tt> ist ein äußerst praktisches Werkzeug, in diesem Fall aber eher ungeeignet. Eine bessere Lösung ist, in der apache Konfiguration einen virtuellen host einzurichten, der alle Anfragen an die subdomain zur Hauptdomain weiterleitet. Damit vermeidet man alle potenziellen SEO, cookie und caching Probleme, und man schont den Prozessor etwas.</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;"># NameVirtualHost *:80</span>
&nbsp;
    <span style="color: #00007f;">ServerName</span> www.seite.de
    <span style="color: #adadad; font-style: italic;"># Dies ist unsere Hauptdomäne</span>
    <span style="color: #adadad; font-style: italic;"># ... Hier erfolgt die weitere Konfiguration</span>
&nbsp;
    <span style="color: #00007f;">ServerName</span> seite.de
    <span style="color: #00007f;">ServerAlias</span> *.seite.de
    <span style="color: #adadad; font-style: italic;"># Hier garantieren wir, dass auch Anfragen wie qqq.seite.de korrekt</span>
    <span style="color: #adadad; font-style: italic;"># weitergeleitet werden.</span>
    <span style="color: #00007f;">Redirect</span> / http://www.seite.de/</pre></div></div>

<p>Es sollte ebenfalls beachtet werden, welche Art von <tt>Redirect</tt> eingesetzt wird, siehe hierzu die <a href="http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect">mod alias Dokumentation</a>. In diesem Beispiel wurde ein 302 benutzt.</p>
<p>Für lighttpd kann man folgendes benutzen:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$HTTP</span><span style="color: #009900;">&#91;</span><span style="color: #ff0000;">&quot;host&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=~</span> <span style="color: #ff0000;">&quot;seite<span style="color: #000099; font-weight: bold;">\.</span>de&quot;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #0000ff;">$HTTP</span><span style="color: #009900;">&#91;</span><span style="color: #ff0000;">&quot;host&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #ff0000;">&quot;www.seite.de&quot;</span> <span style="color: #009900;">&#123;</span>
        url<span style="color: #339933;">.</span>redirect <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>
            <span style="color: #ff0000;">&quot;^(.*)$&quot;</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #ff0000;">&quot;http://www.seite.de$1&quot;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Dies kann man auch auf schon bestehenden Seiten durchführen, der PageRank z.B. sollte sich nicht verändern bzw. nach kurzer Zeit auf den alten Wert zurückkehren.</p>
<p><tt>IIS</tt> Benutzer, könnten sich für diese (englische) <a href="http://www.xoc.net/works/tips/domain.asp">Seite</a> interessieren.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicolaskuttler.de/2009/10/22/alle-subdomains-zur-hauptdomane-weiterleiten/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
