<?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>configuration Archives - Blog IT</title>
	<atom:link href="https://blogit.create.pt/tag/configuration/feed/" rel="self" type="application/rss+xml" />
	<link>https://blogit.create.pt/tag/configuration/</link>
	<description>Create IT blogger community</description>
	<lastBuildDate>Thu, 10 Jan 2019 12:46:06 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>Redirecting 2 domains from http to https and non-www to www</title>
		<link>https://blogit.create.pt/andresantos/2018/10/30/redirecting-2-domains-from-http-to-https-and-non-www-to-www/</link>
					<comments>https://blogit.create.pt/andresantos/2018/10/30/redirecting-2-domains-from-http-to-https-and-non-www-to-www/#respond</comments>
		
		<dc:creator><![CDATA[André Santos]]></dc:creator>
		<pubDate>Tue, 30 Oct 2018 12:25:59 +0000</pubDate>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[naked domain]]></category>
		<category><![CDATA[non-www]]></category>
		<category><![CDATA[redirection]]></category>
		<category><![CDATA[web.config]]></category>
		<category><![CDATA[www]]></category>
		<guid isPermaLink="false">https://blogit.create.pt/?p=7670</guid>

					<description><![CDATA[<p>Recently I had to configure some redirections in a website that contains two different domains. Both use https and I want the main site, which uses the primary domain, to only be accessible through it&#8217;s www version. For the second site, since it&#8217;s a sub-domain, I only want it to only be available in https. [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andresantos/2018/10/30/redirecting-2-domains-from-http-to-https-and-non-www-to-www/">Redirecting 2 domains from http to https and non-www to www</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Recently I had to configure some redirections in a website that contains two different domains.</p>
<p>Both use https and I want the main site, which uses the primary domain, to only be accessible through it&#8217;s www version. For the second site, since it&#8217;s a sub-domain, I only want it to only be available in https.</p>
<p><span id="more-7670"></span></p>
<p>Let&#8217;s say the domain is <strong>mydomain.com</strong> and the subdomain is <strong>mysub.mydomain.com</strong>. The only URLs I want to be available are:</p>
<ul>
<li>https://www.mydomain.com</li>
<li>https://mysub.mydomain.com</li>
</ul>
<p>Typically I would make the non-www to www redirection through the DNS provider, but for this website it was not possible.</p>
<p>The following is the configuration I used in my Web.config:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;rewrite&gt;
    &lt;rules&gt;
        &lt;rule name=&quot;Redirect from non www mydomain.com&quot; stopProcessing=&quot;true&quot;&gt;
            &lt;match url=&quot;.*&quot; /&gt;
            &lt;conditions&gt;
                &lt;add input=&quot;{HTTP_HOST}&quot; pattern=&quot;^mydomain.com$&quot; /&gt;
            &lt;/conditions&gt;
            &lt;action type=&quot;Redirect&quot; url=&quot;https://www.mydomain.com/{R:0}&quot; redirectType=&quot;Permanent&quot; /&gt;
        &lt;/rule&gt;
        &lt;rule name=&quot;Redirect from non https mydomain.com&quot; stopProcessing=&quot;true&quot;&gt;
            &lt;match url=&quot;.*&quot; /&gt;
            &lt;conditions&gt;
                &lt;add input=&quot;{HTTPS}&quot; pattern=&quot;^OFF$&quot; /&gt;
                &lt;add input=&quot;{HTTP_HOST}&quot; pattern=&quot;^www.mydomain.com$&quot; /&gt;
            &lt;/conditions&gt;
            &lt;action type=&quot;Redirect&quot; url=&quot;https://www.mydomain.com/{R:0}&quot; redirectType=&quot;Permanent&quot; /&gt;
        &lt;/rule&gt;
        &lt;rule name=&quot;Redirect from non https mysub.mydomain.com&quot; stopProcessing=&quot;true&quot;&gt;
            &lt;match url=&quot;.*&quot; /&gt;
            &lt;conditions&gt;
                &lt;add input=&quot;{HTTPS}&quot; pattern=&quot;^OFF$&quot; /&gt;
                &lt;add input=&quot;{HTTP_HOST}&quot; pattern=&quot;^mysub.mydomain.com$&quot; /&gt;
            &lt;/conditions&gt;
            &lt;action type=&quot;Redirect&quot; url=&quot;https://mysub.mydomain.com/{R:0}&quot; redirectType=&quot;Permanent&quot; /&gt;
        &lt;/rule&gt;
    &lt;/rules&gt;
&lt;/rewrite&gt;
</pre>
<p>Hope this helps!</p>
<p>The post <a href="https://blogit.create.pt/andresantos/2018/10/30/redirecting-2-domains-from-http-to-https-and-non-www-to-www/">Redirecting 2 domains from http to https and non-www to www</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andresantos/2018/10/30/redirecting-2-domains-from-http-to-https-and-non-www-to-www/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
