
<?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>Achari.in &#187; url rewriting using .htaccess</title>
	<atom:link href="http://www.achari.in/tag/url-rewriting-using-.htaccess/feed" rel="self" type="application/rss+xml" />
	<link>http://www.achari.in</link>
	<description>achari.in is a programmer&#039;s blog maintained by Anoop S Achari. Tutorials focus on Google Map API Integration, Twitter OAuth, Facebook Integration, Jquery, JSE, SCJP Materials and other technical articles.</description>
	<lastBuildDate>Thu, 26 Jan 2012 08:58:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Rewrite .php extension with .html using .htaccess &#124; URL rewriting using .htaccess.</title>
		<link>http://www.achari.in/rewrite-php-extension-with-html-using-htaccess-url-rewriting-using-htaccess</link>
		<comments>http://www.achari.in/rewrite-php-extension-with-html-using-htaccess-url-rewriting-using-htaccess#comments</comments>
		<pubDate>Sat, 21 Aug 2010 17:20:21 +0000</pubDate>
		<dc:creator>anoopsachari</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[misc]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rewrite .php with .html using .htaceess in php]]></category>
		<category><![CDATA[url rewriting using .htaccess]]></category>

		<guid isPermaLink="false">http://www.achari.in/?p=440</guid>
		<description><![CDATA[I had to implement URL rewriting in my last project . After some browsing found that it can be implemented using .htaccess file . Ok fine . we can start from the basics of creating a .htaccess file . In windows one cannot create .htaccess file directly . You can either create a &#8220;htaccess&#8221; file [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; padding-bottom:10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.achari.in%2Frewrite-php-extension-with-html-using-htaccess-url-rewriting-using-htaccess"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.achari.in%2Frewrite-php-extension-with-html-using-htaccess-url-rewriting-using-htaccess&amp;source=anoopsachari&amp;style=normal&amp;service=TinyURL.com" height="61" width="50" /><br />
			</a>
		</div>
<p>I had to implement URL rewriting in my last project . After some browsing found that it can be implemented using <strong>.htaccess </strong> file . </p>
<p>Ok fine . we can start from the basics of creating a .htaccess file . </p>
<p>In windows one cannot create .htaccess file directly . You can either create a &#8220;htaccess&#8221; file on windows upload it and rename it to &#8220;.htaccess&#8221; <strong>or</strong> create a notepad file and save it as &#8220;.htaccess&#8221; file .</p>
<p><strong>Begin Rewriting</strong></p>
<p>Whenever you use mod_rewrite (the part of Apache that does all this magic), you need to do</p>
<pre class="brush: xml;">
Options +FollowSymlinks
RewriteEngine on
</pre>
<p>before any ReWrite rules. note: +FollowSymLinks must be enabled for any rules to work, this is a security requirement of the rewrite engine. Normally it&#8217;s enabled in the root and you shouldn&#8217;t have to add it, but it doesn&#8217;t hurt to do so, and I&#8217;ll insert it into all the examples on this page, just in case*.</p>
<p>The next line simply switches on the rewrite engine for that folder. if this directive is in you main .htaccess file, then the ReWrite engine is theoretically enabled for your entire site, but it&#8217;s wise to always add that line before you write any redirections, anywhere.</p>
<p><strong>Simple Rewriting</strong></p>
<p>You can rewrite all .php files with .html tag . Use following code to implement the same . </p>
<pre class="brush: xml;">
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.html $1\.php
</pre>
<p>Now try .html with .php extension . ie , help.html would call help.php .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.achari.in/rewrite-php-extension-with-html-using-htaccess-url-rewriting-using-htaccess/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

