<?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>Wowebmaster.com &#187; htaccess</title>
	<atom:link href="http://www.wowebmaster.com/tag/htaccess/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wowebmaster.com</link>
	<description>World of Webmaster: Sharing Experiences</description>
	<lastBuildDate>Wed, 27 May 2009 10:31:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Htaccess Redirects</title>
		<link>http://www.wowebmaster.com/linux/htaccess-redirects/</link>
		<comments>http://www.wowebmaster.com/linux/htaccess-redirects/#comments</comments>
		<pubDate>Wed, 14 May 2008 15:25:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.wowebmaster.com/blog/?p=5</guid>
		<description><![CDATA[A tutorial on htaccess' redirect methods]]></description>
			<content:encoded><![CDATA[<p>Web site creating is making directories and files connected in someway. If you even have fewer web sites, you probably came across with the situations you wanted to redirect your visitors to someother pages. You might move your domain to a new one, change your file&#8217;s extensions or change your subfolder name.</p>
<p>There are different methods for different kinds of problems. If you are looking for htaccess solutions, here is the methods:</p>
<blockquote><p>If you don&#8217;t have a &#8220;.htaccess&#8221; file (a hidden file) on your server, create one and upload it in ASCII mode</p></blockquote>
<p><strong>Simple Page Redirect:</strong><br />
The following code will redirect your visitors from example.html to example2.html page.</p>
<p><code>Redirect 301 /example.html http://www.domain.com/example2.html</code></p>
<p>301 means you redirected the page permanently. If it is a temporary redirect, remove that 301 from the code.</p>
<p><strong>Simple Folder Redirect:</strong><br />
The following code will redirect all the visitors to another folder.</p>
<p><code>Redirect 301 /shop https://www.domain.com/shop</code></p>
<p><strong>Redirect to Matched Page/Folder:</strong></p>
<p>If you want to redirect your old domain to a new domain with all the files and subfolders, the following code will redirect a visitor (or search engine) to the same file at the new domain.</p>
<p><code>RedirectMatch 301 ^(.*)$ http://www.newdomain.com/</code></p>
<p>Alternatively you can use this:</p>
<p><code>Options +FollowSymLinks<br />
RewriteEngine on<br />
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L] </code></p>
<p>This code will redirect all the visitors from olddomain.com/whatever to newdomain.com/whatever so there will be no need to redirect all the pages individually.</p>
<p><strong>Redirect to New File Extension</strong></p>
<p>If you changed some file extensions and want to redirect your visitors to new extensions, you may want to add the following code to your htaccess:</p>
<p><code>RedirectMatch 301 (.*)\.html$ http://www.example.com$1.php</code></p>
<p>This code will redirect all the html files to php extension pages. Meaning your visitors will be redirected to domain.com/home.php instead of domain.com/home.html.</p>
<p><strong>Redirect Your Whole Root Folder to a SubFolder</strong></p>
<p>Say you have your website under a folder named &#8220;subfolder&#8221;, and you want to access those files from your root folder as well. For example you want to access &#8220;domain.com/subfolder/page.html&#8221; from &#8220;domain.com/page.html&#8221;. The following code will do the trick.</p>
<p><code>RewriteEngine On<br />
Options +FollowSymlinks<br />
RewriteBase /<br />
RewriteCond %{HTTP_HOST} domain.com<br />
RewriteCond %{REQUEST_URI} !subfolder/<br />
RewriteRule ^(.*)$ subfolder/$1 [L]</code></p>
<p><strong>Redirect www to non www version of site</strong></p>
<p><code>Options +FollowSymLinks<br />
RewriteEngine on<br />
RewriteCond %{HTTP_HOST} .<br />
RewriteCond %{HTTP_HOST} !^example\.com<br />
RewriteRule (.*) http://example.com/$1 [R=301,L]</code></p>
<p><strong>Redirect non-www to www</strong></p>
<p><code>Options +FollowSymLinks<br />
RewriteEngine on<br />
RewriteCond %{HTTP_HOST} ^yoursite.com [NC]<br />
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301] </code></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?&amp;linkurl=http%3A%2F%2Fwww.wowebmaster.com%2Flinux%2Fhtaccess-redirects%2F&amp;linkname=Htaccess%20Redirects"><img src="http://www.wowebmaster.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.wowebmaster.com/linux/htaccess-redirects/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Password Protected Pages: Htpasswd and Htaccess</title>
		<link>http://www.wowebmaster.com/linux/password-protected-pages-htpasswd-htaccess/</link>
		<comments>http://www.wowebmaster.com/linux/password-protected-pages-htpasswd-htaccess/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 15:50:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[htpasswd]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.wowebmaster.com/blog/?p=1</guid>
		<description><![CDATA[Guide to password protect your folders/pages using htaccess and htpasswd.]]></description>
			<content:encoded><![CDATA[<p>Password protected web pages may have crucial importance for you, if you want to hide some of your pages to public. If you have a configured apache server for this, it&#8217;s so easy to do the rest to add a password and a user to protect a page or folder.</p>
<p>Here how it is done:</p>
<p><strong>1. Configuring your htaccess</strong></p>
<p>If you do not have a .htaccess file on your website&#8217;s directory, create it. But don&#8217;t forget that it is a hidden file, if you are using SSH Secure Shell&#8217;s browser, you have to select &#8220;View&#8221; &gt;&gt; &#8221; Show Hidden Files &#8221; to see whether you have created one, before.</p>
<p>Now, add the following code to your .htaccess file.</p>
<p><code>AuthName "Restricted Area"<br />
AuthType Basic<br />
AuthUserFile /&lt;fullpath&gt;/yourwebsite.com/private-folder/.htpasswd<br />
require valid-user</code></p>
<p>After AuthName field, write a message that will be seen on the authentication screen and don&#8217;t forget to add your fullpath after the AuthUserFile field. It is usually something like this: AuthUserFile /home/.servername/www/yourdomain.com/ .htpasswd</p>
<p><strong>2. Configuring your .htpasswd</strong></p>
<p>.htpasswd is a hidden file that has the encrypted password combinations of your users for authentication. It must be put in a non-public folder, to prevent visitors from viewing this file via a browser. You can put it such as directly above your public HTML folder. Now you understand what it stands for. This htpasswd can be directly created via command line of Linux servers. On the prompt screen of your linux server, type the following command and be sure to run this command above your html folder:</p>
<p><code>htpasswd -cmd .htpasswd &lt;username&gt;</code></p>
<p>You&#8217;ll be prompted to write your desired password. After that, go to yourwebsite.com/private-folder/ to see if everything is ok. You&#8217;ll be asked to login with your username and password.</p>
<p><strong>3. Adding More Users</strong></p>
<p>Adding more users is easy. Just type the following command on the command screen of your server:</p>
<p><code>htpasswd .htaccess </code></p>
<p>Type the desired password and that&#8217;s all.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?&amp;linkurl=http%3A%2F%2Fwww.wowebmaster.com%2Flinux%2Fpassword-protected-pages-htpasswd-htaccess%2F&amp;linkname=Password%20Protected%20Pages%3A%20Htpasswd%20and%20Htaccess"><img src="http://www.wowebmaster.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.wowebmaster.com/linux/password-protected-pages-htpasswd-htaccess/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
