<?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>Web Design &#38; Development Talk &#187; htaccess file</title>
	<atom:link href="http://www.web-design-talk.co.uk/tag/htaccess-file/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.web-design-talk.co.uk</link>
	<description>Web Design &#38; Development Blog</description>
	<lastBuildDate>Thu, 29 Dec 2011 15:34:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Getting htaccess Mod-rewrite rules working locally with XAMPP</title>
		<link>http://www.web-design-talk.co.uk/126/getting-htaccess-mod-rewrite-working-locally-with-xampp/</link>
		<comments>http://www.web-design-talk.co.uk/126/getting-htaccess-mod-rewrite-working-locally-with-xampp/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 00:28:46 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[XAMPP]]></category>
		<category><![CDATA[htaccess file]]></category>
		<category><![CDATA[relative path]]></category>
		<category><![CDATA[rewrite rule]]></category>

		<guid isPermaLink="false">http://www.web-design-talk.co.uk/?p=126</guid>
		<description><![CDATA[After spending a whole 2 hours of my life trying to get Apache mod-rewrite rules working with XAMPP on a local computer, I thought I&#8217;d share my results as I seemingly tried everything. The problem, I have a simple mod-rewrite rule in my htaccess file. When I upload this to my online web host everything [...]]]></description>
			<content:encoded><![CDATA[<p>After spending a whole 2 hours of my life trying to get Apache mod-rewrite rules working with <a href="http://www.apachefriends.org/en/xampp.html" target="_blank">XAMPP</a> on a local computer, I thought I&#8217;d share my results as I seemingly tried everything. The problem, I have a simple mod-rewrite rule in my htaccess file. When I upload this to my online web host everything is fine &#8211; the working htaccess file  for my online host:</p>
<pre class="brush: jscript; title: ; notranslate">
RewriteBase /
RewriteEngine on
RewriteRule amnesia/resetpass(.*) recover-password.php$1 [PT]
</pre>
<p>So typing in <code>www.domain.com/amnesia/resetpass</code> does a simple re-write to <code>www.domain.com/recover-password.php</code>, without the user ever knowing. All is fine. However, when I treid to get this seemingly simple rule to work with XAMPP I ran into problems, getting 404 and 500 responses from the server &#8211; obviously quite a pain as this essentially means I can&#8217;t test the site using my own web server (E.g. localhost). The site hosted from my computer via the normal setup E.g. xampp/htdocs/mysite. I&#8217;ll jump straight to the solution and then explain exactly what things were changed &#8211; the working htaccess file is below:</p>
<pre class="brush: jscript; title: ; notranslate">
RewriteEngine on
RewriteBase /mysite
options +FollowSymLinks
RewriteRule amnesia/resetpass(.*) recover-password.php$1 [PT]
</pre>
<p>Firstly, the extra line that uses the <code>+FollowSymLinks</code> directive was added. To explain this I&#8217;ll quote straught from the <a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html" target="_blank">Apache documentation</a>:</p>
<blockquote><p>To enable the rewriting engine           for per-directory configuration files, you need to set           &#8220;<code>RewriteEngine On</code>&#8221; in these files           <strong>and</strong> &#8220;<code>Options           FollowSymLinks</code>&#8221; must be enabled. If your           administrator has disabled override of           <code>FollowSymLinks</code> for a user&#8217;s directory, then           you cannot use the rewriting engine. This restriction is           needed for security reasons.</p></blockquote>
<p>The re-write base has been changed to the relative path of the website directory. To finish up, open the http.conf file (the default settings for XAMPP, that get overwritten with you .htaccess file rules on a directory basis), located by default at C:\xampp\apache\conf\http.conf. Find all occurances of <code>AllowOverride None</code> and change it to <code>AllowOverride All</code>. After restarting XAMPP everythign should work. In a nutshell changing the AllowOverride directive in the http.conf file decalres which directives in .htaccess files can override directives from httpd.conf, this is <a href="http://vr-zone.com/manual/en/mod/core.html#allowoverride" target="_self">discussed in more dept over here</a>, but basically by having this directive set to None, you&#8217;re stopping individual htaccess files from working locally.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.web-design-talk.co.uk/126/getting-htaccess-mod-rewrite-working-locally-with-xampp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

