<?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>Php Development &#187; htaccess</title>
	<atom:link href="http://www.maheshchari.com/tag/htaccess/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maheshchari.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 17 Jan 2012 02:42:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>htaccess hotlinker</title>
		<link>http://www.maheshchari.com/htaccess-hotlinker/</link>
		<comments>http://www.maheshchari.com/htaccess-hotlinker/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 02:37:29 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[Html]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=644</guid>
		<description><![CDATA[How to stop hotlinking our web assets like images, music , video other files? I recently i launched my project that will generates funny logo of user&#8217;s name , i worked around one week to complete this php script generates the funny logo. After one or two weeks users directly linking their logo to my [...]]]></description>
			<content:encoded><![CDATA[<h1>How to stop hotlinking our web assets like images, music , video other files?</h1>
<p>I recently i launched my project that will generates <a href="#" target="_blank">funny logo of user&#8217;s name</a> , i worked around one week to complete this php script generates the<a href="http://myhomepagezone.com/" target="_blank"> funny logo</a>. After one or two weeks users directly linking their logo to my hosting server ,than downloading and hosting on their server.This is called <strong>hotlinking</strong> where visitors will use directly from our hosted web assets.</p>
<p>So i want stop this <strong>hotlinking</strong> from <strong>hotlinker</strong> with htaccess , thanks to apache<a href="http://www.maheshchari.com/enable-mod_rewrite-on-apache/"> htaccess rewrite rules</a>  <img src='http://www.maheshchari.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .</p>
<p>Here is my small tweak to my <strong>htaccess</strong> file that prevents hotlinking. </p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">RewriteEngine on
RewriteCond  %{HTTP_REFERER} !^$
RewriteCond  %{HTTP_REFERER} !^http(s)?://(www\.)?maheshchari.com [NC]
RewriteRule  \.(jpg|jpeg|png|gif)$ http://www.maheshchari.com/hotlink.jpg [NC,R,L]</pre></div></div>

<p>In the above code snippet second and third lines are conditions , if the referrer is blank or <a href="maheshchari.com">maheshchari.com</a> we allow images can be linked , if not we replace that images with hotlink.jpg image.</p>
<p>We can do this for not only images ,we can do it for other media files like mp3, video files, doc files also. </p>
<p><strong>Remember:</strong></p>
<p>You must replace the url to <strong>image</strong> or any <strong>doc</strong> file corresponding media type file.</p>
<p>You must allow some websites like facebook,google i.e famaous social networking sites, search engins. </p>
<p>for this you can add as many conditions you want like below</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?google\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?yahoo\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?technorati\.com/ [NC]
&nbsp;
with this method we can find the hotlinker also by redirecting to our mail sender php script the 
referrer.</pre></div></div>

<p>&nbsp;</p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=644&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/htaccess-hotlinker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>htaccess directory index</title>
		<link>http://www.maheshchari.com/htaccess-directory-index/</link>
		<comments>http://www.maheshchari.com/htaccess-directory-index/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 00:45:22 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[Html]]></category>
		<category><![CDATA[directory index]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=640</guid>
		<description><![CDATA[htaccess directory index generelly when we access the directory on webserver, we get index.html or index.htm or default.asp or index.php. in some situation we need to change the directory default page to other or specified page. We can set this with htaccess file on server . remember before going to view this tutorial , you [...]]]></description>
			<content:encoded><![CDATA[<h1>htaccess directory index</h1>
<p>generelly when we access the directory on webserver, we get index.html or index.htm or default.asp or index.php. </p>
<p>in some situation we need to change the directory default page to other or specified page. We can set this with htaccess file on server . remember before going to view this tutorial , you have to <a href="http://www.maheshchari.com/how-to-check-weather-mod_rewrite-module-is-enabled/">check htaccess enabled</a> by your web hosting provider. </p>
<p>open your favorite text editor and add following text to it and save as .htacces  name . </p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">DirectoryIndex mydirectory.html</pre></div></div>

<p>So when you open some url like </p>
<p>http://www.yoursite.com/directory/</p>
<p>you will serve the mydirectory.html as default page. </p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=640&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/htaccess-directory-index/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php auto append ,prepend file using htaccess</title>
		<link>http://www.maheshchari.com/php-auto-append-prepend-file-using-htaccess/</link>
		<comments>http://www.maheshchari.com/php-auto-append-prepend-file-using-htaccess/#comments</comments>
		<pubDate>Sun, 23 May 2010 05:10:57 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[PHP/mysql]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=553</guid>
		<description><![CDATA[Automatically append and prepend a php file to current script using htaccess It is best practice to add common file to every php script in our application ,such as libraries cleaning input variables from $_GET,$_POST,$_COOKIE,cleaning or modifying the output of the php script by providing plug in functionality. We know best example for this many [...]]]></description>
			<content:encoded><![CDATA[<h1>Automatically append and prepend a php file to current script using htaccess</h1>
<p>It is best practice to add common file to every php script in our application ,such as libraries  cleaning input variables from $_GET,$_POST,$_COOKIE,cleaning or modifying the output of the php script by providing plug in functionality. </p>
<p>We know best example for this many free hosting providers use this settings. they append a advertisement script to our files while it output buffering.</p>
<p>here we learn how to add or remove append or prepend files using htaccess. to continue this tutorial we must have the knowledge of htaccess of apache and basic settings in php.ini</p>
<h2>add files to script</h2>
<p>this can be achieved by  <b>auto_append_file</b> and <b>auto_prepend_file</b> php  configuration options.These options can be set in the PHP config, virtual host settings or in a .htaccess file. This post shows how to set these and how to override a setting so no file is appended or prepended.</p>
<h3>Example</h3>
<p>We have three files append.php, mainscript.php, prepend.php and htaccess file to achieve this.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//prepend.php</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;p&gt;this is the prepended file&lt;/p&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//mainscript.php</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;p&gt;this is the main file&lt;/p&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//append.php</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;p&gt;this is the appended file&lt;/p&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h2>Out put of our mainscript file</h2>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;p&gt;this is the prepended file&lt;/p&gt;
&lt;p&gt;this is the main file&lt;/p&gt;
&lt;p&gt;this is the appended file&lt;/p&gt;</pre></div></div>

<h2>Set up php values in htaccess</h2>
<p>prepending a file</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">php_value auto_prepend_file prepend.php</pre></div></div>

<p>Append a file</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">php_value auto_prepend_file append.php</pre></div></div>

<h2>Removing or modify existing values</h2>
<p>we can override these values for each php file or each directory in our application. we can remove existing auto_append ,auto_prepend values by setting its values to none.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">php_value auto_append_file none
php_value auto_prepend_file none</pre></div></div>

<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=553&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/php-auto-append-prepend-file-using-htaccess/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>htaccess custom error documents</title>
		<link>http://www.maheshchari.com/htaccess-custom-error-documents/</link>
		<comments>http://www.maheshchari.com/htaccess-custom-error-documents/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 16:30:27 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[seo]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=472</guid>
		<description><![CDATA[htaccess custom error documents The htaccess gives you the ability to redirect the visitor to different pages if they try to access an invalid page. You can use a custom error page for any type of error as long as you know its number. using custom error page helps lot to increase the performence in [...]]]></description>
			<content:encoded><![CDATA[<h1>htaccess custom error documents</h1>
<p>The <strong>htaccess</strong> gives you the ability to redirect the visitor to different pages if they try to access an invalid page. You can use a <strong>custom error</strong> page for any type of <strong>error</strong> as long as you know its number. using custom error page helps lot to increase the performence in Search Engine Optimizaton.</p>
<p>To know detailed http <strong>error codes</strong> refer to <a href="http://www.maheshchari.com/http-protocol-codes/" target="_blank">my previous post</a>.to work out this you need to add these htaccess command to your httaccess file and include in your server root folder.</p>
<p>To know how to user htaccess file please refere to<a href="http://www.maheshchari.com/enable-htaccess-apache/" target="_blank"> my previouse post</a>.</p>
<p>Example: <strong>404 Page Not Found.</strong> The layout for this command is :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ErrorDocument errornumber /filename.html</pre></div></div>

<p>So if you create a page called <strong>NotFound.html</strong> and you wanted to use it as the <strong>404 error page</strong>, the command would be :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ErrorDocument 404 /NotFound.html</pre></div></div>

<p>If you want to keep all of the error pages in a separate directory, just include the directory name in the file path :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ErrorDocument 404 /errorpages/NotFound.html</pre></div></div>

<p>
The most used error documents are :</p>
<p><strong>400	Bad Request</strong> A generic kind of error that people get into by doing some strange stuff with your URL or scripts.  </p>
<p><strong>401	Authorization Required</strong>	When someone tries to enter a protected area without proper authorization.</p>
<p> <strong>403	Forbidden </strong>When a file with permissions not allowing it to be accessed by the user is requested.  </p>
<p><strong>404	Not Found</strong>	Kinda obvious.  </p>
<p><strong>500	Internal Server Error</strong>	This may help you with internal server errors in any scripts you have running.</p>
<p>There are many others, To view complete http error code see <a href="http://www.maheshchari.com/http-protocol-codes/" target="_blank">my previous post</a>.</p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=472&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/htaccess-custom-error-documents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>http protocol codes</title>
		<link>http://www.maheshchari.com/http-protocol-codes/</link>
		<comments>http://www.maheshchari.com/http-protocol-codes/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 16:42:27 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[seo]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=468</guid>
		<description><![CDATA[Http protocol error and response code reference. we know that web servers and web client uses mostly common protocol is HTTP, we need use response codes in our application . So i made a simple and breif reference below Successful Client Requests 200 OK 201 Created 202 Accepted 203 Non-Authorative Information 204 No Content 205 [...]]]></description>
			<content:encoded><![CDATA[<h1>Http protocol  error and response code reference.</h1>
<p>we know that web servers and web client uses mostly common protocol is HTTP, we need use response codes  in our application . So i made a simple and breif reference below</p>
<h3>Successful Client Requests</h3>
<p>200  	OK<br />
201 	Created<br />
202 	Accepted<br />
203 	Non-Authorative Information<br />
204 	No Content<br />
205 	Reset Content<br />
206 	Partial Content</p>
<h3>Client Request Redirected</h3>
<p>300 	Multiple Choices<br />
301 	Moved Permanently<br />
302 	Moved Temporarily<br />
303 	See Other<br />
304 	Not Modified<br />
305 	Use Proxy</p>
<h3>Client Request Errors</h3>
<p>400 	Bad Request<br />
401 	Authorization Required<br />
402 	Payment Required (not used yet)<br />
403 	Forbidden<br />
404 	Not Found<br />
405 	Method Not Allowed<br />
406 	Not Acceptable (encoding)<br />
407 	Proxy Authentication Required<br />
408 	Request Timed Out<br />
409 	Conflicting Request<br />
410 	Gone<br />
411 	Content Length Required<br />
412 	Precondition Failed<br />
413 	Request Entity Too Long<br />
414 	Request URI Too Long<br />
415 	Unsupported Media Type</p>
<h3>Server Errors</h3>
<p>500 	Internal Server Error<br />
501 	Not Implemented<br />
502 	Bad Gateway<br />
503 	Service Unavailable<br />
504 	Gateway Timeout<br />
505 	HTTP Version Not Supported </p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=468&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/http-protocol-codes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to check weather mod_rewrite module is enabled</title>
		<link>http://www.maheshchari.com/how-to-check-weather-mod_rewrite-module-is-enabled/</link>
		<comments>http://www.maheshchari.com/how-to-check-weather-mod_rewrite-module-is-enabled/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 09:52:49 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[other]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=440</guid>
		<description><![CDATA[How to check weather mod_rewrite module is enabled or not? We know the impotence of the Search Engine Friendly URLs . To make an application SEF preferable we must have .htaccess permissions and mod_rewrite module enabled. Here we discuss if apache web server mod_rewrite module enabled or not. Step1: Open your note pad and pate [...]]]></description>
			<content:encoded><![CDATA[<h1>How to check weather mod_rewrite module is enabled or not?</h1>
<p>We know the impotence of the Search Engine Friendly URLs . To make an application SEF preferable we must have <a href="http://www.maheshchari.com/enable-htaccess-apache/">.htaccess permissions</a> and <a href="http://www.maheshchari.com/enable-mod_rewrite-on-apache/">mod_rewrite module enabled</a>.</p>
<p>Here we discuss if apache web server mod_rewrite module enabled or not.</p>
<p><b>Step1:</b> Open your note pad and pate below code in it and Save as phpinfo.php.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">phpinfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</p>
<p><b>Step2:</b> Now preview this page and find the &#8220;mod_rewrite&#8221; in the column of &#8220;Loaded modules&#8221;.<br />
<a href="http://www.maheshchari.com/wp-content/uploads/2010/03/mod_rewrite.gif"><img src="http://www.maheshchari.com/wp-content/uploads/2010/03/mod_rewrite-300x186.gif" alt="" title="mod_rewrite" width="300" height="186" class="alignlcenter size-medium wp-image-441" /></a></p>
<p><b>Step3:</b> If we found this we enabled mod_rewrite module.</p>
<p><b>Step4:</b>if we didn&#8217;t found ,we can enable it by reading my <a href="http://www.maheshchari.com/enable-mod_rewrite-on-apache/"> previous article</a>.</p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=440&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/how-to-check-weather-mod_rewrite-module-is-enabled/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable mod_rewrite on apache</title>
		<link>http://www.maheshchari.com/enable-mod_rewrite-on-apache/</link>
		<comments>http://www.maheshchari.com/enable-mod_rewrite-on-apache/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 09:21:09 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[other]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=438</guid>
		<description><![CDATA[How to enable mode_rewrite module on apache Before enabling this module for SEF URL s ,we must have permission to use .htaccess file .Please read my previous post to enable .htacess. Before beginning this article ,please back up your apache configuration file httpd.conf file located in apache installation. Now open with note pad this configuration [...]]]></description>
			<content:encoded><![CDATA[<h1>How to enable mode_rewrite module on apache</h1>
<p>Before enabling this module for SEF URL s ,we must have permission to use .htaccess file .Please read my <a href="http://www.maheshchari.com/enable-htaccess-apache/" target="_blank">previous post</a> to enable <b>.htacess</b>.</p>
<p>Before beginning this article ,please back up your apache configuration file httpd.conf file located in apache installation.</p>
<p>Now open with note pad this configuration file and find the below the lin</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">#LoadModule rewrite_module modules/mod_rewrite.so</pre></div></div>

<p>Now remove the &#8220;#&#8221; symbol in the above line,results modified looks below</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">LoadModule rewrite_module modules/mod_rewrite.so</pre></div></div>

<p>Now Save the file and restart the apache now mod_rewrite module is enabled.</p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=438&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/enable-mod_rewrite-on-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>enable htaccess apache</title>
		<link>http://www.maheshchari.com/enable-htaccess-apache/</link>
		<comments>http://www.maheshchari.com/enable-htaccess-apache/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 08:51:17 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[other]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=431</guid>
		<description><![CDATA[Enable htacces for directories we know that htaccess permission must on apache web server like making SEF urls, directory permissions..etc.here we discuss about how to check .htaccess enabled. Before we begin this tutorial, please make sure you make a backup copy of the original httpd.conf apache configuration file located in apache installation folder in case [...]]]></description>
			<content:encoded><![CDATA[<h1>Enable htacces for directories</h1>
<p>we know that htaccess permission must on apache web server like making SEF urls, directory permissions..etc.here we discuss about how to check .htaccess enabled.</p>
<p>Before we begin this tutorial, please make sure you make a backup copy of the original <b>httpd.conf</b> apache configuration  file located in apache installation folder  in case we make a mistake, this way we can always go back to the original configuration file </p>
<p>Now open
<p>httpd.conf</p>
<p> file with note pad and find the below text</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;Directory /&gt;
    Options FollowSymLinks
    AllowOverride none
    Order deny,allow
    Deny from all
    Satisfy all
&lt;/Directory&gt;</pre></div></div>

<p>Then replace <b>AllowOverride none</b> to <b>AllowOverride All</b>. Modified version looks as below</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;Directory /&gt;
    Options FollowSymLinks
    AllowOverride all
    Order deny,allow
    Deny from all
    Satisfy all
&lt;/Directory&gt;</pre></div></div>

<p>Above change tells the apache to use .htaccess as per directory bases.<br />
Now we can use .htaccess files .</p>
<p><h3>Remember</h3>
<p>Remember while uploading .htaccess file to remote server make sure the file transfer in ASCII mode, generally with windows operating  system FTP programs use binary mode.</p>
<p>Generally FTP programs doesn&#8217;t display the .htaccess files by default ,we must force the FTP program to show hidden files like .htaccess files.</p>
<p>When you save <b>.htaccess</b> file with note pad  it saves as <b>.htaccess.txt</b> .Make sure <b>.htaccess</b> is a file extension not a file name with empty name.</p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=431&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/enable-htaccess-apache/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Codeigniter htaccess</title>
		<link>http://www.maheshchari.com/codeigniter-htaccess/</link>
		<comments>http://www.maheshchari.com/codeigniter-htaccess/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 06:07:26 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=423</guid>
		<description><![CDATA[Enable SEF URL in Codeigniter We are familiar with Codeigniter comes with optional SEF URLs, but we use non SEF urls in production or development version. 1 2 http://localhost/index.php/helloworld/welcome/ http://localhost/helloworld/welcom/ In the above snippet we know that line 1 is default URL which contains index.php in URl part that used in development version. Second line [...]]]></description>
			<content:encoded><![CDATA[<h1>Enable SEF URL in Codeigniter</h1>
<p>We are familiar with Codeigniter comes with optional SEF URLs, but we use non SEF urls in production or development version.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">http://localhost/index.php/helloworld/welcome/
http://localhost/helloworld/welcom/</pre></td></tr></table></div>

<p>In the above snippet we know that line 1 is default URL which contains index.php in URl part that used in development version.<br />
Second line is the deployed version SEF URL, generally we need some tweaks with .htaccess and configure stuff. </p>
<h3>htaccess</h3>
<p>Open note pad and copy and paste below code into that and save it as <b>.htaccess</b> and copy this file into your codeigniters root directory where it was installed.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]</pre></td></tr></table></div>

<p><b>Line 1:</b>  set index.php as default directory index instead of index.html </p>
<p><b>Line 2:</b>  Start rewriting engine on</p>
<p><b>Line 3:</b>  start a condition that won&#8217;t meet this situation where the request to static resources like images , css, javascript , robot text files  </p>
<p><b>Line 4:</b>  make condition user requests a valid request</p>
<p><b>Line 5:</b>  make condition no physical file exists with the given URL</p>
<p><b>Line 6:</b>  if above conditions all met redirect the request to index.php on installation </p>
<h3>making changes to config.php  file</h3>
<p>open the file in the directory <b>system/application/config/config.php </b> make following changes.<br />
Find below line</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'index_page'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;index.php&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Replace above line with below code</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'index_page'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now test the new URLs ,it done.</p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=423&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/codeigniter-htaccess/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to host multiple domains in a single hosting package</title>
		<link>http://www.maheshchari.com/how-to-host-multiple-domains-in-a-single-hosting-package/</link>
		<comments>http://www.maheshchari.com/how-to-host-multiple-domains-in-a-single-hosting-package/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 17:29:07 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[seo]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=399</guid>
		<description><![CDATA[How to host multiple domains in a single hosting package. In our real time,we work mostly small websites where limited static files are hosted. So in that case we waste additional money for less than a Mb files. Here we learn simple hack how to add multiple sites to single account using single .htaccess file. [...]]]></description>
			<content:encoded><![CDATA[<h1>How to host multiple domains in a single hosting package.</h1>
<p>In our real time,we work mostly small websites where limited static files are hosted. So in that case we waste additional money for less than a Mb files. Here we learn simple hack how to add multiple sites to single account using single .htaccess file.</p>
<p>For example, if you are hosting your domain name &quot;<strong>maheshchari.com</strong>&quot; with us and added a Domain Alias for &quot;<strong>mahesh.com</strong>&quot;, then <strong>http://www.maheshchari.com</strong> and <strong>http://www.mahesh.com</strong> would take a visitor to the exact same pages of  <strong>maheshchari.com</strong> website. <strong>http://maheshchari.com/somefile.html </strong>would bring someone to the exact same page as <strong>http://mahesh.com/somefile.html</strong>. 
</p>
<p>Using this method, you can host an additional website within your account for each Domain  you add. Or you can point the <strong>mahesh.com</strong> same as <strong>maheshchari.com</strong>,So you are adding &quot;<strong>A</strong>&quot; same for both domains in DNS management . </p>
<p>After that This is a custom configuration requiring a couple extra steps. </p>
<p>After Pointing both domain to same Server IP , then place an .htaccess file in /htdocs/www of the following example format: </p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">RewriteEngine On
RewriteCond %{HTTP_HOST}  mahesh.com$ [NC]
RewriteCond %{REQUEST_URI} !^/mahesh/.*$
RewriteRule ^(.*)$  /mahesh/$1</pre></div></div>

<p>Then, upload your HTML files maheshchari.com to <strong>/htdocs/www/</strong> and your HTML files for <strong>mahesh.com</strong> to <strong>/htdocs/www/mahesh </strong></p>
<p>Remeber you can&#8217;t add emails for <strong>mahesh.com</strong> for that .</p>
<p>&nbsp;</p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=399&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/how-to-host-multiple-domains-in-a-single-hosting-package/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

