<?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>Bobz&#039;s playground &#187; url rewrite</title>
	<atom:link href="http://www.bobz.com.hr/blog/tag/url-rewrite/feed" rel="self" type="application/rss+xml" />
	<link>http://www.bobz.com.hr/blog</link>
	<description>Bobz&#039;s playground, tech stuff web related</description>
	<lastBuildDate>Mon, 30 Aug 2010 13:30:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Simple URL rewrite to www domain</title>
		<link>http://www.bobz.com.hr/blog/of-topik/simple-url-rewrite-to-www-domain.php</link>
		<comments>http://www.bobz.com.hr/blog/of-topik/simple-url-rewrite-to-www-domain.php#comments</comments>
		<pubDate>Mon, 16 Mar 2009 19:26:35 +0000</pubDate>
		<dc:creator>Bobz</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Of topik]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[mod rewrite]]></category>
		<category><![CDATA[url rewrite]]></category>

		<guid isPermaLink="false">http://www.bobz.com.hr/blog/?p=336</guid>
		<description><![CDATA[<a href="http://www.bobz.com.hr/blog/of-topik/simple-url-rewrite-to-www-domain.php"><img src="http://www.bobz.com.hr/blog/wp-content/uploads/2009/03/url-rewrite-150x150.jpg" class="imgtfe" hspace="0" align="left" width="160" alt="Simple URL rewrite to www domain" title="Simple URL rewrite to www domain" /></a>
If your domain can be reached trough domain.com and www.domain.com and you don&#8217;t want that, you can do simple rewrite with .htaccess file to change this.
1. Create new file with you favorite text editor and save it as: .htaccess
2. Copy/paste these lines in your file:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]

3. Replace &#8220;domain&#8221; with your [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bobz.com.hr/blog/wp-content/uploads/2009/03/url-rewrite.jpg" alt="Simple URL rewrite to www domain" title="Simple URL rewrite to www domain" width="540" height="300" class="alignnone size-full wp-image-343" /><br />
If your domain can be reached trough domain.com and www.domain.com and you don&#8217;t want that, you can do simple rewrite with .htaccess file to change this.</p>
<p>1. Create new file with you favorite text editor and save it as: .htaccess<br />
2. Copy/paste these lines in your file:<br />
<em><br />
RewriteEngine On<br />
RewriteCond %{HTTP_HOST} ^domain.com$<br />
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]<br />
</em><br />
3. Replace &#8220;domain&#8221; with your domain name</p>
<p>For example, rewrite for my domain (http://www.bobz.com.hr) would be:<br />
<em><br />
RewriteEngine On<br />
RewriteCond %{HTTP_HOST} ^bobz.com.hr$<br />
RewriteRule (.*) http://www.bobz.com.hr/$1 [R=301,L]<br />
</em><br />
4. Save file and upload it to your web site root directory (public_html)</p>
<p>Also you can revers this, if you want to display your domain as: http://domain.com, then you would use this:<br />
<em><br />
RewriteEngine on<br />
RewriteCond %{http_host} ^www.bobz.com.hr$<br />
RewriteRule ^(.*)$ http://bobz.com.hr/$1 [R=301,L]<br />
</em></p>
<p>I think all of modern CMS systems have url rewrite by default included, so you can use built in functions. This example is useful if you are working on a static HTML site.<br />
Be sure that you are using Apache web server and have enabled mod_rewrite module before using these rules.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobz.com.hr/blog/of-topik/simple-url-rewrite-to-www-domain.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
