<?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>.htaccess Archives - AtCodex: Empowering Your Financial Journey &amp; Personal Well-Being</title>
	<atom:link href="https://atcodex.com/tag/htaccess/feed/" rel="self" type="application/rss+xml" />
	<link>https://atcodex.com/tag/htaccess/</link>
	<description>Achieve financial success without sacrificing well-being! AtCodex provides actionable strategies for managing money, time, and personal growth—all in one place.</description>
	<lastBuildDate>Sat, 28 Aug 2021 17:15:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://atcodex.com/wp-content/uploads/2020/05/cropped-New-Project-1-32x32.png</url>
	<title>.htaccess Archives - AtCodex: Empowering Your Financial Journey &amp; Personal Well-Being</title>
	<link>https://atcodex.com/tag/htaccess/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to redirect www to non-www and HTTP to HTTPS in Apache using .htaccess</title>
		<link>https://atcodex.com/how-to/how-to-redirect-www-to-non-www-and-http-to-https-in-apache-using-htaccess/</link>
		
		<dc:creator><![CDATA[atcodex]]></dc:creator>
		<pubDate>Sat, 04 Jul 2020 20:50:02 +0000</pubDate>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Apache]]></category>
		<guid isPermaLink="false">https://atcodex.com/?p=337</guid>

					<description><![CDATA[<p>Did you notice that some website&#8217;s names start with or without WWW? This creates a duplicate content issue on google and also impacts our website SEO. Search engines see&#160;www.abc.com&#160;and&#160;abc.com&#160;as two &#8230; </p>
<p>The post <a href="https://atcodex.com/how-to/how-to-redirect-www-to-non-www-and-http-to-https-in-apache-using-htaccess/">How to redirect www to non-www and HTTP to HTTPS in Apache using .htaccess</a> appeared first on <a href="https://atcodex.com">AtCodex: Empowering Your Financial Journey &amp; Personal Well-Being</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Did you notice that some website&#8217;s names start with or without WWW? This creates a duplicate content issue on google and also impacts our website SEO. </p>



<p class="wp-block-paragraph">Search engines see<strong>&nbsp;www.abc.com&nbsp;</strong>and<strong>&nbsp;abc.com&nbsp;</strong>as two different websites with the same content. This causes them to see a lot of&nbsp;duplicate content, which they don&#8217;t like and most of the time does not allow website pages to rank in google.</p>



<p class="wp-block-paragraph">When your website is not directing traffic to&nbsp;<strong>www.abc.com</strong>&nbsp;and&nbsp;<strong>abc.com</strong>&nbsp;to the same URL. It is crucial that you fix this. Use the&nbsp;rel=&#8221;canonical&#8221; tag&nbsp;to tell google search engines which one is the main version of the website.  Use .htaccess file to redirect all page versions to main.</p>



<h2 class="wp-block-heading" id="introduction">Introduction</h2>



<p class="wp-block-paragraph">Here we will show you how to redirect a website from www to non-www and from HTTP to HTTPS, using the .htaccess file in Apache server. The following are the steps below.</p>



<pre class="wp-block-code"><code>http:&#47;&#47;abc.com
http://www.abc.com
https://abc.com
</code></pre>



<p class="wp-block-paragraph"><strong>to</strong></p>



<pre class="wp-block-code"><code>https:&#47;&#47;abc.com
</code></pre>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="apache-configuration">Apache Configuration (.htaccess file)</h2>



<p class="wp-block-paragraph">Add the following code in your .htaccess  file, which you can get at the root of the website.  If it is not visible in FTP then try to login to your server and go into the website root folder. Still, if you are unable to find hidden files (.<strong><code>htaccess</code></strong>)  there then visits <strong><a href="https://atcodex.com/how-to/how-to-enable-or-disable-the-hidden-htaccess-files-in-cpanel/">How to enable or disable the hidden (.htaccess) files in cPanel</a></strong>. <b>Dotfiles</b> are considered hidden files in Cpanel</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">If instead of&nbsp;<code><strong>abc.com</strong></code> if&nbsp;you need the default URL to be&nbsp;<code><strong>www.abc.com</strong></code>, then simply change the third and the fifth lines:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [L,NE,R=301]</pre>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://atcodex.com/how-to/how-to-redirect-www-to-non-www-and-http-to-https-in-apache-using-htaccess/">How to redirect www to non-www and HTTP to HTTPS in Apache using .htaccess</a> appeared first on <a href="https://atcodex.com">AtCodex: Empowering Your Financial Journey &amp; Personal Well-Being</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
