<?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>Libre Things &#187; Apache</title>
	<atom:link href="http://positon.org/tag/apache/feed" rel="self" type="application/rss+xml" />
	<link>http://positon.org</link>
	<description></description>
	<lastBuildDate>Tue, 23 Feb 2016 20:01:11 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.7.1</generator>
	<item>
		<title>(Français) Redirection mobile avec lien vers le site normal</title>
		<link>http://positon.org/redirection-mobile-avec-lien-vers-le-site-normal</link>
		<comments>http://positon.org/redirection-mobile-avec-lien-vers-le-site-normal#comments</comments>
		<pubDate>Wed, 07 Oct 2009 09:03:00 +0000</pubDate>
		<dc:creator><![CDATA[dooblem]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Squid]]></category>

		<guid isPermaLink="false">http://positon.org:81/?p=61</guid>
		<description><![CDATA[Sorry, this entry is only available in Français.]]></description>
				<content:encoded><![CDATA[<p>Sorry, this entry is only available in <a href="http://fr.positon.org/tag/apache/feed">Français</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://positon.org/redirection-mobile-avec-lien-vers-le-site-normal/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Squid 2.6 redirection</title>
		<link>http://positon.org/squid-26-redirection</link>
		<comments>http://positon.org/squid-26-redirection#comments</comments>
		<pubDate>Thu, 30 Jul 2009 14:46:00 +0000</pubDate>
		<dc:creator><![CDATA[dooblem]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Squid]]></category>

		<guid isPermaLink="false">http://positon.org:81/?p=57</guid>
		<description><![CDATA[In the vast majority of cases, http redirections are installed on the http server. However, the redirection cannot be installed in the http server config in some cases. Example: mobile phone redirection. We want to redirect all mobile phones from http://www.mysite.com to http://mobile.mysite.com The client type is done with the HTTP User-Agent header sent by [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>In the vast majority of cases, http redirections are installed on the http server.<br />
However, the redirection cannot be installed in the http server config in some cases.</p>
<p>Example: mobile phone redirection.<br />
We want to redirect all mobile phones from http://www.mysite.com to http://mobile.mysite.com</p>
<p>The client type is done with the HTTP <strong>User-Agent</strong> header sent by the browser. Problem: Squid will put in cache only one version of the query to http://www.mysite.com. The response from the cache will probably be the home page, not the 301 redirection.</p>
<p>It&#8217;s also possible to configure the HTTP server to add the <code>Vary: User-Agent</code> header to tell Squid to store one version by browser. With this the cache will be split (one cache per browser), lowering a lot the cache efficiency.</p>
<p>Here is the solution:</p>
<pre>
###################################
# we redirect mobiles to mobile.mysite.com
url_rewrite_program /etc/squid/redirect_mobile.sh

acl symbian browser Symbian
acl iphone browser iP(hone|od)
acl mobile_url dstdomain mobile.monsite.com

url_rewrite_access deny mobile_url
url_rewrite_access allow symbian
url_rewrite_access allow iphone
url_rewrite_access deny all
</pre>
<p>And the <code>/etc/squid/redirect_mobile.sh</code> script simply contains:</p>
<pre>
#!/bin/sh
while read line
do
        echo &quot;301:http://mobile.mysite.com&quot;
done
</pre>
<p><ins>Notes</ins>:</p>
<ul>
<li>The mobile detection method is far from being exhaustive. If you know a simple method covering 95% of browsers, I&#8217;m interested!</li>
<li>With more recent Squid versions (3, 2.HEAD), you can use a better method using <strong>internal redirectors</strong>.</li>
</ul>
<p><ins>Links</ins>:</p>
<ul>
<li><a href="http://www.squid-cache.org/Versions/v2/2.6/cfgman/" title="http://www.squid-cache.org/Versions/v2/2.6/cfgman/">http://www.squid-cache.org/Versions/v2/2.6/cfgman/</a></li>
<li><a href="http://wiki.squid-cache.org/Features/Redirectors" title="http://wiki.squid-cache.org/Features/Redirectors">http://wiki.squid-cache.org/Features/Redirectors</a></li>
<li><a href="http://wiki.squid-cache.org/Features/InternalRedirectors" title="http://wiki.squid-cache.org/Features/InternalRedirectors">http://wiki.squid-cache.org/Features/InternalRedirectors</a></li>
<li><a href="http://wiki.squid-cache.org/ConfigExamples/PhpRedirectors" title="http://wiki.squid-cache.org/ConfigExamples/PhpRedirectors">http://wiki.squid-cache.org/ConfigExamples/PhpRedirectors</a></li>
<li><a href="http://www1.za.squid-cache.org/mail-archive/squid-users/200507/0247.html" title="http://www1.za.squid-cache.org/mail-archive/squid-users/200507/0247.html">http://www1.za.squid-cache.org/mail-archive/squid-users/200507/0247.html</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://positon.org/squid-26-redirection/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>(Français) [Apache] Liste des virtualhosts sous Debian</title>
		<link>http://positon.org/apache-liste-des-virtualhosts-sous-debian</link>
		<comments>http://positon.org/apache-liste-des-virtualhosts-sous-debian#comments</comments>
		<pubDate>Mon, 29 Jun 2009 08:56:00 +0000</pubDate>
		<dc:creator><![CDATA[dooblem]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://positon.org:81/?p=54</guid>
		<description><![CDATA[Sorry, this entry is only available in Français.]]></description>
				<content:encoded><![CDATA[<p>Sorry, this entry is only available in <a href="http://fr.positon.org/tag/apache/feed">Français</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://positon.org/apache-liste-des-virtualhosts-sous-debian/feed</wfw:commentRss>
		<slash:comments></slash:comments>
		</item>
	</channel>
</rss>
