<?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>Robin&#039;s Tech Tips &#187; apache</title>
	<atom:link href="http://robin.mytechtip.com/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://robin.mytechtip.com</link>
	<description>Just another My Tech Tip weblog</description>
	<lastBuildDate>Wed, 06 Jul 2011 02:35:54 +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>Bad Request Error with apache mod_rewrite</title>
		<link>http://robin.mytechtip.com/2009/11/05/bad-request-error-with-apache-mod_rewrite/</link>
		<comments>http://robin.mytechtip.com/2009/11/05/bad-request-error-with-apache-mod_rewrite/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 04:09:30 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[clean url]]></category>
		<category><![CDATA[mod_rewrite]]></category>

		<guid isPermaLink="false">http://robin.mytechtip.com/?p=56</guid>
		<description><![CDATA[If you use apache module mod_alias together with module mod_rewrite, you probably encounter &#8220;Bad Request&#8221; error if the settings are not correctly configured.



For example, if you want to make the folder &#8220;/opt/mysite_v1.2&#8243; have the alias as &#8220;/mysite&#8221; so it can be accessed as http://www.mydomain.com/mysite. And you want to have clean url &#8220;/mysite/page1&#8243; mapped to &#8220;/mysite/index.php?p=page1&#8243;.
To [...]]]></description>
			<content:encoded><![CDATA[<p>If you use apache module mod_alias together with module mod_rewrite, you probably encounter &#8220;Bad Request&#8221; error if the settings are not correctly configured.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3371750151985752";
google_ad_slot = "0950801022";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<br />
For example, if you want to make the folder &#8220;/opt/mysite_v1.2&#8243; have the alias as &#8220;/mysite&#8221; so it can be accessed as http://www.mydomain.com/mysite. And you want to have clean url &#8220;/mysite/page1&#8243; mapped to &#8220;/mysite/index.php?p=page1&#8243;.</p>
<p>To define the alias, just add the following in the httpd.conf file:</p>
<blockquote><p><span style="font-family: Courier New">Alias /mysite/ &#8220;/opt/mysite_v1.2/&#8221; </span><br />
<span style="font-family: Courier New">&lt;Directory &#8220;/opt/mysite_v1.2/&#8221;&gt;</span><br />
<span style="font-family: Courier New"> Options Indexes FollowSymLinks MultiViews</span><br />
<span style="font-family: Courier New"> AllowOverride all</span><br />
<span style="font-family: Courier New"> Order allow,deny</span><br />
<span style="font-family: Courier New"> Allow from all</span><br />
<span style="font-family: Courier New">&lt;/Directory&gt;</span></p></blockquote>
<p>To allow clean URL. you need to have the following in the &#8220;.htaccess&#8221; file in the folder &#8220;/opt/mysite_v1.2&#8243;</p>
<blockquote><p><span style="font-family: Courier New">RewriteEngine On</span><br />
<span style="font-family: Courier New"># Rewrite base</span><br />
<strong>RewriteBase   /mysite</strong></p>
<p><span style="font-family: Courier New">#  now the rewriting rules</span><br />
<span style="font-family: Courier New">RewriteRule   ^([0-9a-zA-Z_]+)$  index.php?p=$1 </span></p></blockquote>
<p>Please NOTE that &#8220;<strong>RewriteBase</strong>&#8221; Directive is very essential. Without it, you will get the well known &#8220;Bad Request&#8221; Error.</p>
<p>More information can be found in <a id="m-3l" title="Apache mod_rewrite document" href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritebase" onclick="javascript:pageTracker._trackPageview('/outbound/article/httpd.apache.org');">Apache mod_rewrite documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://robin.mytechtip.com/2009/11/05/bad-request-error-with-apache-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

