<?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>MaggsWeb:7 &#187; htaccess</title>
	<atom:link href="http://www.maggsweb.com/tag/htaccess/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maggsweb.com</link>
	<description>www.maggsweb.com</description>
	<lastBuildDate>Fri, 03 Feb 2012 22:50:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>URL rewriting &#8211; WordPress style</title>
		<link>http://www.maggsweb.com/html/url-rewriting-wordpress-style/</link>
		<comments>http://www.maggsweb.com/html/url-rewriting-wordpress-style/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 13:17:40 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.maggsweb.com/?p=480</guid>
		<description><![CDATA[Add this into your .htaccess file&#8230; ?View Code APACHERewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 The first RewriteCond checks if the requested URL exists as a file on the filesystem. In mod_rewrite, -f refers to a file, while the bang is the &#8220;not&#8221; operator. Therefore, !-f means &#8220;if the request script [...]]]></description>
			<content:encoded><![CDATA[<p>Add this into your .htaccess file&#8230;</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p480code2'); return false;">View Code</a> APACHE</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4802"><td class="code" id="p480code2"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">On</span>
<span style="color: #00007f;">RewriteCond</span> %{SCRIPT_FILENAME} !-f
<span style="color: #00007f;">RewriteCond</span> %{SCRIPT_FILENAME} !-d
<span style="color: #00007f;">RewriteRule</span> ^(.*)$ index.php/$<span style="color: #ff0000;">1</span></pre></td></tr></table></div>

<p><span id="more-480"></span><br />
The first <b>RewriteCond</b> checks if the requested URL exists as a file on the filesystem. In <b>mod_rewrite</b>, <b>-f</b> refers to a file, while the bang is the &#8220;not&#8221; operator. Therefore, <b>!-f</b> means &#8220;if the request script filename does not exist as a file&#8221;.</p>
<p>If the first <b>rewrite_cond</b> succeeds (that is, the requested file wasn&#8217;t found), then Apache moves on to the next condition. The <b>!-d</b> directive means it the condition succeeds if the requested script does correspond to an existing directory on the server.</p>
<p>Finally, if both conditions succeed, the request is forwarded to the <b>index.php</b> file, as specified in the <b>RewriteRule</b> directive.</p>
<p>You can now access request POST data.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/html/url-rewriting-wordpress-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Authentication in .htaccess</title>
		<link>http://www.maggsweb.com/mysql/mysql-authentication-in-htaccess/</link>
		<comments>http://www.maggsweb.com/mysql/mysql-authentication-in-htaccess/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 08:25:24 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.maggsweb.com/?p=399</guid>
		<description><![CDATA[Not tried and tested by me (yet) but I am assured that this is the way to do do this&#8230; ?View Code APACHE&#160; AuthName &#34;MySQL Authentication&#34; AuthType Basic &#160; AuthMySQLHost localhost AuthMySQLUser accesssecurity AuthMySQLPassword DBPWD AuthMySQLDB accesssecurity &#160; AuthMySQLUserTable users AuthMySQLNameField username AuthMySQLPasswordField password AuthMySQLPwEncryption none &#160; AuthMySQLUserCondition &#34;user_status=1&#34; AuthMySQLAuthoritative On AuthMySQLEnable On &#160; require [...]]]></description>
			<content:encoded><![CDATA[<p>Not tried and tested by me (yet) but I am assured that this is the way to do do this&#8230;<br />
<span id="more-399"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p399code4'); return false;">View Code</a> APACHE</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3994"><td class="code" id="p399code4"><pre class="apache" style="font-family:monospace;">&nbsp;
<span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;MySQL Authentication&quot;</span>
<span style="color: #00007f;">AuthType</span> Basic
&nbsp;
AuthMySQLHost localhost
AuthMySQLUser accesssecurity
AuthMySQLPassword DBPWD
AuthMySQLDB accesssecurity
&nbsp;
AuthMySQLUserTable users
AuthMySQLNameField username
AuthMySQLPasswordField password
AuthMySQLPwEncryption <span style="color: #0000ff;">none</span>
&nbsp;
AuthMySQLUserCondition <span style="color: #7f007f;">&quot;user_status=1&quot;</span>
AuthMySQLAuthoritative <span style="color: #0000ff;">On</span>
AuthMySQLEnable <span style="color: #0000ff;">On</span>
&nbsp;
<span style="color: #00007f;">require</span> valid-<span style="color: #00007f;">user</span>
&nbsp;
<span style="color: #00007f;">DirectoryIndex</span> index.html
&nbsp;
<span style="color: #00007f;">ErrorDocument</span> <span style="color: #ff0000;">401</span> /errors/error_not_authenticated.html
<span style="color: #00007f;">ErrorDocument</span> <span style="color: #ff0000;">403</span> /errors/error_forbidden.html
<span style="color: #00007f;">ErrorDocument</span> <span style="color: #ff0000;">404</span> /errors/error_not_found.html
<span style="color: #00007f;">ErrorDocument</span> <span style="color: #ff0000;">500</span> /errors/error_oops.html</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/mysql/mysql-authentication-in-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flickering images inside &lt;a&gt;&#8217;s</title>
		<link>http://www.maggsweb.com/html/flickering-images-inside-links/</link>
		<comments>http://www.maggsweb.com/html/flickering-images-inside-links/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 15:18:48 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://tech.maggsweb.co.uk/?p=278</guid>
		<description><![CDATA[In IE6 and sometimes in IE7 the background images flicker if they’re also an &#60;a&#62;.  A small edition to .htaccess overrides the browsers default to load the backgrounds every time. ExpiresActive On ExpiresByType image/gif A2592000 ExpiresByType image/jpeg A2592000 ExpiresByType image/png A2592000 Reqires mod_expire on an Apache server (most have it).]]></description>
			<content:encoded><![CDATA[<p>In IE6 and sometimes in IE7 the background images flicker if they’re also an &lt;a&gt;.  A small edition to .htaccess overrides the browsers default to load the backgrounds every time.</p>
<p><span id="more-278"></span></p>
<pre>
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/png A2592000
</pre>
<p>Reqires mod_expire on an Apache server (most have it).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/html/flickering-images-inside-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Error redirects with .htaccess</title>
		<link>http://www.maggsweb.com/html/custom-error-redirects/</link>
		<comments>http://www.maggsweb.com/html/custom-error-redirects/#comments</comments>
		<pubDate>Thu, 07 May 2009 12:37:55 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://tech.maggsweb.co.uk/?p=238</guid>
		<description><![CDATA[Cold hard website errors are horrible and unnecessary. All you need is a few nice looking .html files in your directory somewhere, then use .htaccess to reditrect to these when there is an error. Obviously, no errors at all would be better&#8230;. The format for the .htaccess is : ErrorDocument errornumber /file.html For example, if [...]]]></description>
			<content:encoded><![CDATA[<p>Cold hard website errors are horrible and unnecessary.  All you need is a few nice looking .html files in your directory somewhere, then use .htaccess to reditrect to these when there is an error.  Obviously, no errors at all would be better&#8230;. <img src='http://www.maggsweb.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<span id="more-238"></span><br />
The format for the .htaccess is :</p>
<p><strong>ErrorDocument errornumber /file.html</strong></p>
<p>For example,  if the file notfound.html was in the root directory of my site and I wanted to use it for a 404 error I would use:</p>
<p><strong>ErrorDocument 404 /notfound.html</strong></p>
<p>If the file is not in the root directory of your site, you just need to put the path to it:</p>
<p><strong>ErrorDocument 500 /errorpages/500.html</strong></p>
<p>These are some of the most common errors:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p238code6'); return false;">View Code</a> APACHE</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2386"><td class="code" id="p238code6"><pre class="apache" style="font-family:monospace;"><span style="color: #ff0000;">401</span> - Authorization Required
<span style="color: #ff0000;">400</span> - Bad request
<span style="color: #ff0000;">403</span> - Forbidden
<span style="color: #ff0000;">500</span> - Internal Server Error
<span style="color: #ff0000;">404</span> - Wrong page</pre></td></tr></table></div>

<p>and they can all be redirected to the same page, different pages, or even a dynamic page&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/html/custom-error-redirects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

