<?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>Vijaya Kumar Blog &#187; Htaccess tips</title>
	<atom:link href="http://vijayakumar.org/tag/htaccess-tips/feed" rel="self" type="application/rss+xml" />
	<link>http://vijayakumar.org</link>
	<description>(Stunning PHP/MYSQL/AJAX/SEO Tips)</description>
	<lastBuildDate>Fri, 03 Sep 2010 02:06:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>5 htaccess Tricks Every Webmaster Should Know</title>
		<link>http://vijayakumar.org/5-htaccess-tricks-every-webmaster-should-know.html</link>
		<comments>http://vijayakumar.org/5-htaccess-tricks-every-webmaster-should-know.html#comments</comments>
		<pubDate>Sat, 08 Aug 2009 18:54:23 +0000</pubDate>
		<dc:creator>Vijaya Kumar</dc:creator>
				<category><![CDATA[Htaccess]]></category>
		<category><![CDATA[301 redirect]]></category>
		<category><![CDATA[custom 404]]></category>
		<category><![CDATA[Htaccess tips]]></category>
		<category><![CDATA[htaccess tricks]]></category>

		<guid isPermaLink="false">http://www.vijayakumar.org/?p=511</guid>
		<description><![CDATA[Here are 5 sets of htaccess directives every webmaster should know: Redirect Visitors While You Update Your Site Update and test your site while visitors are redirected to the page of your choice: order deny,allow deny from all allow from 123.123.123.123 ErrorDocument 403 /page.html &#60;Files page.html&#62; allow from all &#60;/Files&#62; order deny,allow deny from all [...]]]></description>
			<content:encoded><![CDATA[<p>Here are 5 sets of htaccess directives every webmaster should know:</p>
<p><strong>Redirect Visitors While You Update Your Site </strong></p>
<p><strong></strong>Update and test your site while visitors are redirected to the page of your choice:</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">order deny,allow</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">deny from all</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">allow from 123.123.123.123</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">ErrorDocument 403 /page.html</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;Files page.html&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">allow from all</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;/Files&gt;</div>
<p><code>order deny,allow</code><br />
<code>deny from all</code><br />
<code>allow from 123.123.123.123</code><br />
<code>ErrorDocument 403 /page.html</code><br />
<code>&lt;Files page.html&gt;</code><br />
<code>allow from all</code><br />
<code>&lt;/Files&gt;</code></p>
<p>Replace 123.123.123.123 with your IP address. Also replace page.html with the name of the page you want visitors to see.</p>
<p><strong>Display a Custom 404 Error Page</strong></p>
<p><strong> </strong>Your server displays a “404 File Not Found” error page whenever a visitor tries to access a page on your site that doesn’t exist.</p>
<p>You can replace the server’s default error page with one of your own that explains the error in plain language and links visitors to your home page. Here’s how to use your own page:</p>
<p><code>ErrorDocument 404 /404.html</code></p>
<p>Replace 404.html with the name of the page you want visitors to see.</p>
<p><strong>Handle Moved or Renamed Pages</strong></p>
<p>You’ve moved or renamed a page on your site and you want visitors automatically sent to the new page when they try to access the old one. Use a 301 redirect:</p>
<p><code>Redirect 301 /old.html http://yoursite.com/new.html</code></p>
<p><strong></strong>Using a 301 redirect also ensures the page doesn’t lose its search engine ranking.</p>
<p><strong>Prevent Directory Browsing</strong></p>
<p><strong></strong>When there’s no index page in a directory, visitors can look and see what’s inside. Some servers are configured to prevent directory browsing like this. If yours isn’t, here’s how to set it up:</p>
<p><code>Options All -Indexes</code></p>
<p><strong>Create User Friendly URLs</strong></p>
<p><strong></strong>Which of the two URLs below looks friendlier?</p>
<p><code>http://yoursite.com/about</p>
<p>http://yoursite.com/pages/about.html</code></p>
<p>When it comes to URLs, as long as the meaning is clear, shorter is always better.</p>
<p>With htaccess and an Apache module called mod_rewrite, you can set up URLs however you want. Your server can show the contents of &#8220;/pages/about.html&#8221; whenever anyone visits &#8220;http://yoursite.com/about&#8221;.</p>
<p>Here are a few examples:</p>
<p><code>RewriteEngine on<br />
RewriteRule ^about/$    /pages/about.html [L]<br />
RewriteRule ^features/$ /features.php [L]<br />
RewriteRule ^buy/$      /buy.html [L]<br />
RewriteRule ^contact/$  /pages/contact.htm [L]</code></p>
<p>I guess, you love above tricks.</p>
<p>Source:  <a title="http://frontdeskapp.com" href="http://frontdeskapp.com/blog/5-htaccess-tricks-every-webmaster-should-know/" target="_blank">frontdeskapp.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://vijayakumar.org/5-htaccess-tricks-every-webmaster-should-know.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Useful URL rewriting examples using .htaccess</title>
		<link>http://vijayakumar.org/useful-url-rewriting-examples-using-htaccess.html</link>
		<comments>http://vijayakumar.org/useful-url-rewriting-examples-using-htaccess.html#comments</comments>
		<pubDate>Sun, 02 Aug 2009 18:34:16 +0000</pubDate>
		<dc:creator>Vijaya Kumar</dc:creator>
				<category><![CDATA[Htaccess]]></category>
		<category><![CDATA[Htaccess tips]]></category>
		<category><![CDATA[RewriteCond]]></category>
		<category><![CDATA[Rewriterule]]></category>
		<category><![CDATA[Useful URL rewriting examples using .htaccess]]></category>

		<guid isPermaLink="false">http://www.vijayakumar.org/?p=436</guid>
		<description><![CDATA[If you are looking for the examples of URL rewriting then this post might be useful for you. In this post, I’ve given five useful examples of URL rewriting using .htacess. Now let’s look at the examples 1)Rewriting product.php?id=12 to product-12.html It is a simple redirection in which .php extension is hidden from the browser’s [...]]]></description>
			<content:encoded><![CDATA[<p>If you are looking for the examples of URL rewriting then this post might be useful for you. In this post, I’ve given five useful examples of URL rewriting using .htacess.</p>
<p>Now let’s look at the examples</p>
<p><strong>1)Rewriting product.php?id=12 to product-12.html</strong></p>
<p>It is a simple redirection in which .php extension is hidden from the browser’s address bar and dynamic url (containing “?” character) is converted into a static URL.</p>
<p><span><code>RewriteEngine on<br />
RewriteRule ^product-([0-9]+)\.html$ product.php?id=$1</code></span></p>
<p><strong>2) Rewriting product.php?id=12 to product/ipod-nano/12.html</strong></p>
<p>SEO expert always suggest displaying the main keyword in the URL. In the following URL rewriting technique you can display the name of the product in URL.</p>
<p><span><code>RewriteEngine on<br />
RewriteRule ^product/([a-zA-Z0-9_-]+)/([0-9]+)\.html$ product.php?id=$2</code></span></p>
<p><strong>3) Redirecting non www URL to www URL</strong></p>
<p>If you type yahoo.com in browser it will be redirected to www.yahoo.com. If you want to do same with your website then put the following code to .htaccess file. What is benefit of this kind of redirection?? Please check the post about <a title="301 redirect in PHP" href="http://roshanbh.com.np/2007/12/301-redirect-in-php-and-htaccess.html">SEO friendly redirect (301) redirect in php and .htaccess.</a></p>
<p><span><code>RewriteEngine On<br />
RewriteCond %{HTTP_HOST} ^optimaxwebsolutions\.com$<br />
RewriteRule (.*) http://www.optimaxwebsolutions.com/$1 [R=301,L]</code></span></p>
<p><strong>4) Rewriting yoursite.com/user.php?username=xyz to yoursite.com/xyz</strong></p>
<p>You all came across twitter, facebook, linkedin etc. Once u see your profile URL . It will be in understandable for format. For Ex: <a title="Link with vijayakumar on facebook" href="http://www.facebook.com/people/Vijay-Kumar/1568302936" target="_blank">http://www.facebook.com/people/Vijay-Kumar/1568302936</a>,<span> <span><a title="Follow vijayakumar on twitter" href="http://twitter.com/Mrvijayakumar" target="_blank">http://twitter.com/Mrvijayakumar</a></span></span><span><strong><span>, </span></strong></span><span><span><a title="Vijaya kumar's linkedin account" href="http://www.linkedin.com/in/mrvijayakumar" target="_blank"><span>http://www.linkedin.com/in</span><span>/</span><span>mrvijayakumar</span></a></span>, etc.,</span> If you want to do the same kind of redirection i.e http://yoursite.com/xyz to http://yoursite.com/user.php?username=xyz then you can add the following code to the .htaccess file.</p>
<p><span><code>RewriteEngine On<br />
RewriteRule ^([a-zA-Z0-9_-]+)$ user.php?username=$1<br />
RewriteRule ^([a-zA-Z0-9_-]+)/$ user.php?username=$1</code></span></p>
<p><strong>5) Redirecting the domain to a new subfolder of inside public_html.</strong></p>
<p>Suppose the you’ve redeveloped your site and all the new development reside inside the “new” folder of inside root folder.Then the new development of the website can be accessed like “test.com/new”. Now moving these files to the root folder can be a hectic process so you can create the following code inside the .htaccess file and place it under the root folder of the website. In result, www.test.com point out to the files inside “new” folder.</p>
<p><span><code>RewriteEngine On<br />
RewriteCond %{HTTP_HOST} ^test\.com$ [OR]<br />
RewriteCond %{HTTP_HOST} ^www\.test\.com$<br />
RewriteCond %{REQUEST_URI} !^/new/<br />
RewriteRule (.*) /new/$1</code></span></p>
<p><span>Source: <a title="http://roshanbh.com.np" href="http://roshanbh.com.np" target="_blank">roshanbh.com.np</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://vijayakumar.org/useful-url-rewriting-examples-using-htaccess.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
