<?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>Prosoxi All about Development &#38; Design &#187; .htaccess</title>
	<atom:link href="http://www.prosoxi.gr/category/programming/htaccess-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.prosoxi.gr</link>
	<description>Development Blog by Professionals</description>
	<lastBuildDate>Thu, 09 Sep 2010 07:16:00 +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>How To Optimize Your Site With GZIP Compression .htaccess</title>
		<link>http://www.prosoxi.gr/2010/09/03/how-to-optimize-your-site-with-gzip-compression-htaccess/</link>
		<comments>http://www.prosoxi.gr/2010/09/03/how-to-optimize-your-site-with-gzip-compression-htaccess/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 09:27:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.prosoxi.gr/?p=1263</guid>
		<description><![CDATA[Setting up the server The “good news” is that we can’t control the browser. It either sends the Accept-encoding: gzip, deflate header or it doesn’t. Our job is to configure the server so it returns zipped content if the browser can handle it, saving bandwidth for everyone (and giving us a happy user). For IIS,]]></description>
			<content:encoded><![CDATA[<h2>Setting up the server</h2>
<p>The “good news” is that we can’t control the browser. It either sends the <code>Accept-encoding: gzip, deflate</code> header or it doesn’t.</p>
<p>Our job is to configure the server so it returns zipped content if  the browser can handle it, saving bandwidth for everyone (and giving us a  happy user).<span id="more-1263"></span></p>
<p>For IIS, <a href="http://technet.microsoft.com/en-us/library/cc771003%28WS.10%29.aspx">enable compression</a> in the settings.</p>
<p>In Apache, <a href="http://httpd.apache.org/docs/2.0/mod/mod_deflate.html">enabling output compression</a> is fairly straightforward. Add the following to your .htaccess file:</p>
<pre><code>
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Or, compress certain file types by extension:
&lt;Files *.html&gt;
SetOutputFilter DEFLATE
&lt;/Files&gt;
</code>
</pre>
<p>Apache actually has two compression options:</p>
<ul>
<li><strong>mod_deflate</strong> is easier to set up and is standard.</li>
<li><strong>mod_gzip</strong> seems more powerful: you can pre-compress content.</li>
</ul>
<p>Deflate is quick and works, so I use it; use mod_gzip if that floats  your boat. In either case, Apache checks if the browser sent the  “Accept-encoding” header and returns the compressed or regular version  of the file. However, some older browsers may have trouble (more below)  and there are special directives you can add to correct this.</p>
<p>If you can’t change your .htaccess file, you can <a href="http://perishablepress.com/press/2007/03/26/fast-effective-php-compression/">use PHP</a> to return compressed content. Give your HTML file a .php extension and add this code to the top:</p>
<pre><code>
In PHP:
&lt;?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?&gt;
</code>
</pre>
<p>We check the “Accept-encoding” header and return a gzipped version of  the file (otherwise the regular version). This is almost like building  your own webserver (what fun!). But really, try to use Apache to  compress your output if you can help it. You don’t want to monkey with  your files.</p>
<h2>Verify Your Compression</h2>
<p>Once you’ve configured your server, check to make sure you’re actually serving up compressed content.</p>
<ul>
<li><strong>Online:</strong> Use the <a href="http://www.gidnetwork.com/tools/gzip-test.php">online gzip test</a> to check whether your page is compressed.</li>
<li><strong>In your browser:</strong> Use <a href="https://addons.mozilla.org/en-US/firefox/addon/60">Web Developer Toolbar</a> &gt; Information &gt; View Document Size (like I did for Yahoo, above) to see whether the page is compressed.</li>
<li><strong>View the headers:</strong> Use <a href="https://addons.mozilla.org/en-US/firefox/addon/3829">Live HTTP Headers</a> to examine the response. Look for a line that says “Content-encoding: gzip”.</li>
</ul>
<p>Be prepared to marvel at the results. The <a href="http://instacalc.com/">instacalc homepage</a> shrunk from 36k to 10k, a 75% reduction in size.</p>
<h2>Try Some Examples</h2>
<p>I’ve set up some pages and a <a href="http://betterexplained.com/examples/compressed/compression-example.zip">downloadable example</a>:</p>
<ul>
<li><a href="http://betterexplained.com/examples/compressed/index.html">index.html</a> – No explicit compression (on this server, I am using compression by default <img src="http://betterexplained.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" /> ).</li>
<li><a href="http://betterexplained.com/examples/compressed/index.htm">index.htm</a> – Explicitly compressed with Apache .htaccess using *.htm as a rule</li>
<li><a href="http://betterexplained.com/examples/compressed/index.php">index.php</a> – Explicitly compressed using the PHP header</li>
</ul>
<p>Feel free to download the files, put them on your server and tweak the settings.</p>
<p><strong>thanks </strong>http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.prosoxi.gr/2010/09/03/how-to-optimize-your-site-with-gzip-compression-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.htaccess SSI Variables</title>
		<link>http://www.prosoxi.gr/2010/07/22/htaccess-ssi-variables/</link>
		<comments>http://www.prosoxi.gr/2010/07/22/htaccess-ssi-variables/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 08:56:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.htaccess]]></category>

		<guid isPermaLink="false">http://www.prosoxi.gr/?p=1225</guid>
		<description><![CDATA[SSI Variables DATE_GMT=Sun Mar 8 22:58:56 2009 DATE_LOCAL=Sun Mar 8 15:58:56 2009 DOCUMENT_NAME=FOOTER.html DOCUMENT_ROOT=/root-srv/protected/askapache.com/sec DOCUMENT_URI=/includes/FOOTER.html GATEWAY_INTERFACE=CGI/1.1 HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_ACCEPT_ENCODING=gzip,deflate HTTP_ACCEPT_LANGUAGE=en-us,en;q=0.5 HTTP_CACHE_CONTROL=max-age=0 HTTP_CONNECTION=keep-alive HTTP_COOKIE=__qca=12298910-686528-46510; __utmb=50625.1.0.11311 HTTP_HOST=www.askapache.com HTTP_KEEP_ALIVE=300 HTTP_REFERER=http://www.askapache.com/htaccess/htaccess.html HTTP_USER_AGENT=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729) LAST_MODIFIED=Sun Mar 8 14:53:50 2009 PATH=/bin:/usr/bin:/sbin:/usr/sbin QUERY_STRING= REMOTE_ADDR=24.123.215.60 REMOTE_PORT=4785 REQUEST_METHOD=GET REQUEST_URI=/htaccess/ SCRIPT_FILENAME=/root-srv/protected/askapache.com/sec/includes/FOOTER.html SCRIPT_NAME=/includes/FOOTER.html SCRIPT_URI=http://www.askapache.com/htaccess/ SCRIPT_URL=/htaccess/]]></description>
			<content:encoded><![CDATA[<h3>SSI Variables</h3>
<pre>DATE_GMT=Sun Mar  8 22:58:56 2009
DATE_LOCAL=Sun Mar  8 15:58:56 2009
DOCUMENT_NAME=FOOTER.html
DOCUMENT_ROOT=/root-srv/protected/askapache.com/sec
DOCUMENT_URI=/includes/FOOTER.html
GATEWAY_INTERFACE=CGI/1.1
HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7
HTTP_ACCEPT_ENCODING=gzip,deflate
HTTP_ACCEPT_LANGUAGE=en-us,en;q=0.5
HTTP_CACHE_CONTROL=max-age=0
HTTP_CONNECTION=keep-alive
HTTP_COOKIE=__qca=12298910-686528-46510;  __utmb=50625.1.0.11311
HTTP_HOST=www.askapache.com
HTTP_KEEP_ALIVE=300
HTTP_REFERER=http://www.askapache.com/htaccess/htaccess.html
HTTP_USER_AGENT=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)
LAST_MODIFIED=Sun Mar  8 14:53:50 2009
PATH=/bin:/usr/bin:/sbin:/usr/sbin
QUERY_STRING=
REMOTE_ADDR=24.123.215.60
REMOTE_PORT=4785
REQUEST_METHOD=GET
REQUEST_URI=/htaccess/
SCRIPT_FILENAME=/root-srv/protected/askapache.com/sec/includes/FOOTER.html
SCRIPT_NAME=/includes/FOOTER.html
SCRIPT_URI=http://www.askapache.com/htaccess/
SCRIPT_URL=/htaccess/
SERVER_ADDR=64.111.114.111
SERVER_ADMIN=webmaster@askapache.com
SERVER_NAME=www.askapache.com
SERVER_PORT=80
SERVER_PROTOCOL=INCLUDED
SERVER_SIGNATURE=
SERVER_SOFTWARE=Apache/2.0.61 (Unix) PHP/4.4.7 mod_ssl/2.0.63 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2 SVN/1.4.2
UNIQUE_ID=dnbtH0Bvcm8A2ZHqcAAAAM
USER_NAME=</pre>
<h3>More SSI Information</h3>
<ol>
<li><a href="http://httpd.apache.org/docs/trunk/mod/mod_include.html">mod_include</a></li>
<li><a href="http://httpd.apache.org/docs/trunk/filter.html">Apache Filters</a></li>
<li><a href="http://httpd.apache.org/docs/trunk/howto/ssi.html">Introduction to Server Side Includes</a></li>
<li><a href="http://httpd.apache.org/docs/trunk/handler.html">Apache Handlers</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.prosoxi.gr/2010/07/22/htaccess-ssi-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>htaccess Redirecting non-www to www with .htaccess</title>
		<link>http://www.prosoxi.gr/2010/06/28/htaccess-redirecting-non-www-to-www-with-htaccess/</link>
		<comments>http://www.prosoxi.gr/2010/06/28/htaccess-redirecting-non-www-to-www-with-htaccess/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 13:17:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.htaccess]]></category>

		<guid isPermaLink="false">http://www.prosoxi.gr/?p=1165</guid>
		<description><![CDATA[If you want to redirect all non-www requests to your site to the www version, all you need to do is add the following code to your .htaccess file: in your .htaccess file RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] This will redirect any requests to http://my-domain.com to http://www.my-domain.com. There are several benefits]]></description>
			<content:encoded><![CDATA[<p>If you want to redirect all non-www requests to your site to the www version, all you need to do is add the following code to your .htaccess file:<br />
in your .htaccess file</p>
<blockquote><p>RewriteEngine On<br />
RewriteCond %{HTTP_HOST} !^www\.<br />
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]</p></blockquote>
<p>This will redirect any requests to http://my-domain.com to http://www.my-domain.com. There are several benefits from doing that:</p>
<p>* It will avoid duplicate content in Google<br />
* It will avoid the possibility of split page rank and/or split link popularity (inbound links).<br />
* It&#8217;s nicer, and more consistent.</p>
<p>Note that if your site has already been indexed by Google without the www, this might cause unwanted side effects, like lost of PR. I don&#8217;t think this would happen, or in any case it would be a temporary issue (we are doing a permanent redirect, 301, so Google should transfer all rankings to the www version). But anyway, use at your own risk!</p>
<p>Something nice about the code above is that you can use it for any website, since it doesn&#8217;t include the actual domain name.<br />
Redirecting www to non-www</p>
<p>If you want to do the opposite, the code is very similar:<br />
in your .htaccess file</p>
<blockquote><p>RewriteEngine On<br />
RewriteCond %{HTTP_HOST} !^my-domain\.com$ [NC]<br />
RewriteRule ^(.*)$ http://my-domain.com/$1 [R=301,L]</p></blockquote>
<p>In this case we are explicitly typing the domain name. I&#8217;m sure it&#8217;s possible to do it in a generic way, but I haven&#8217;t had the time to work one out and test it. So remember to change &#8216;my-domain&#8217; with your domain name!<span id="more-1165"></span></p>
<div>
<div id="post-23">
<h2><a title="Permanent Link: Generic non-www to www (and vice  versa) 301 redirect using .htaccess" rel="bookmark" href="http://www.cakephp.nu/quick-tip-generic-nonwww-www-vice-versa-301-redirect-htaccess">Generic non-www to www (and vice  versa) 301 redirect using .htaccess</a></h2>
<p><abbr title="2008-11-03T16:33:06+0100">November 3, 2008 – 4:33 pm</abbr> <!-- by Biesbjerg --></p>
<h2>The problem:</h2>
<p>I’ve always hardcoded the domain name in my htaccess’es, requiring me  to make changes each time I deploy a new website.</p>
<h2>The solution:</h2>
<p>Behold, an alternate, generic method of redirecting non-www to www  and www to non-www, requiring no changes between deployments!</p>
<h3>Non-www to www</h3>
<pre>RewriteCond %{HTTP_HOST} !^www\.
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]</pre>
<h3>www to non-www</h3>
<pre>RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^/(.*)$ http://%1/$1 [R=301,L]</pre>
<h3>Bonus tip: Remove trailing slash from address line</h3>
<p>RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]</p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.prosoxi.gr/2010/06/28/htaccess-redirecting-non-www-to-www-with-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>friendly url with htaccess</title>
		<link>http://www.prosoxi.gr/2010/03/04/redirect-a-page-to-name-anchor-within-htaccess/</link>
		<comments>http://www.prosoxi.gr/2010/03/04/redirect-a-page-to-name-anchor-within-htaccess/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 09:58:26 +0000</pubDate>
		<dc:creator>kostas</dc:creator>
				<category><![CDATA[.htaccess]]></category>

		<guid isPermaLink="false">http://www.prosoxi.gr/?p=997</guid>
		<description><![CDATA[suppose you want /articles.php?cat=$1&#38;art=$2 to become magazine/1/2 then you need these two rules: #articles.php?cat=$1&#38;art=$2 RewriteRule ^magazine/([^/]*)/([^/]*)$ /articles.php?cat=$1&#38;art=$2&#38;marker [L] RewriteCond %{REQUEST_URI} /articles\.php [NC] RewriteCond %{QUERY_STRING} ^cat=(.*)&#38;art=(.*) RewriteCond %{QUERY_STRING} !marker RewriteRule (.*) http://mydomain/%1/%2? [R=301,L]]]></description>
			<content:encoded><![CDATA[<p>suppose you want <strong>/articles.php?cat=$1&amp;art=$2</strong> to become <strong>magazine/1/2</strong></p>
<p>then you need these two rules:</p>
<p>#articles.php?cat=$1&amp;art=$2<br />
<strong>RewriteRule ^magazine/([^/]*)/([^/]*)$ /articles.php?cat=$1&amp;art=$2&amp;marker [L]</strong></p>
<p>RewriteCond %{REQUEST_URI} /articles\.php [NC]<br />
RewriteCond %{QUERY_STRING} ^cat=(.*)&amp;art=(.*)<br />
RewriteCond %{QUERY_STRING} !marker</p>
<p><strong>RewriteRule (.*) http://mydomain/%1/%2? [R=301,L]</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.prosoxi.gr/2010/03/04/redirect-a-page-to-name-anchor-within-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top 5 Online .htaccess Mod Rewrite Rules Generator</title>
		<link>http://www.prosoxi.gr/2010/03/01/top-5-online-htaccess-mod-rewrite-rules-generator/</link>
		<comments>http://www.prosoxi.gr/2010/03/01/top-5-online-htaccess-mod-rewrite-rules-generator/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 12:48:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.htaccess]]></category>

		<guid isPermaLink="false">http://www.prosoxi.gr/?p=990</guid>
		<description><![CDATA[You might be aware of mod_rewrite rule and .htaccess file if you are using wordpress as your Blogging platform, .htaccess is the apache’s default directory level configuration files which can be used to password protect and redirect requests. Webmasters need to give special attentions to .htaccess on apache webserver as its very difficult to enforce]]></description>
			<content:encoded><![CDATA[<p>You might be aware of <strong>mod_rewrite rule</strong> and <strong>.htaccess file</strong> if you are using wordpress as your Blogging platform, .htaccess is the apache’s default directory level configuration files which can be used to password protect and redirect requests. Webmasters need to give special attentions to .htaccess on apache webserver as its very difficult to enforce all policies using just <strong>httpd.conf</strong> file.<span id="more-990"></span></p>
<p><strong>mod_rewrite rules</strong> are the power of <strong>apache</strong> which lets you to do magic with <strong>redirection</strong>. Using mod_rewrite rule you can create <strong>SEO friendly URL’s</strong>, <strong>forward specific request</strong> to any other domain, restrict access to webpages or website based on user agent and much more.</p>
<p>However creating proper mod rewrite rules could be hassle and its not that much easy and requires the knowledge of regular expression.</p>
<p>Here is list of,</p>
<h3>Top 5 Online .htaccess Mod Rewrite Rules Generator</h3>
<p><a title="cooletips.de" rel="external nofollow" href="http://cooletips.de/htaccess/" target="_blank">http://cooletips.de/htaccess/</a></p>
<p>This website lets to generate detailed <strong>.htaccess mod rewrite rules</strong> as well as htaccess files, custom error pages, <strong>MIME types</strong>, <strong>Cache Control</strong>, <strong>Password Protect Directory</strong> for your blog or websites</p>
<p><a title="webmaster-money" rel="external nofollow" href="http://www.webmaster-money.org/tools/htaccess_generator.php" target="_blank">http://www.webmaster-money.org/tools/htaccess_generator.php</a></p>
<p>This website lets you to generate <strong>htaccess file</strong>, <strong>password protect directory</strong>, <strong>rewrite rules</strong>, <strong>custom error pages</strong>.</p>
<p><a title="xem247" rel="external nofollow" href="http://xem247.com/tool/htaccess.php" target="_blank">http://xem247.com/tool/htaccess.php</a></p>
<p>This website lets you to generate <strong>Search Engine Friendly URL’s</strong>.</p>
<p><a title="developers evrsoft" rel="external nofollow" href="http://developers.evrsoft.com/tools-htaccess-generator.shtml" target="_blank">http://developers.evrsoft.com/tools-htaccess-generator.shtml</a></p>
<p>This website lets you to generate <strong>.htaccess file</strong>, <strong>hotlink protection</strong>, <strong>custom error pages</strong>, <strong>mod rewrite rules</strong>, <strong>password protect directories</strong>.</p>
<p><a title="generate it" rel="external nofollow" href="http://www.generateit.net/mod-rewrite/" target="_blank">http://www.generateit.net/mod-rewrite/</a></p>
<p>This is simple <strong>mod rewrite rule generator</strong> which lets you to generate <strong>SEO friendly URLs</strong> for <strong>dynamic URLs</strong>.</p>
<p>I Hope above <strong>online .htaccess mod rewrite rule generators</strong> will be helpful to <strong>Bloggers</strong> and <strong>Webmasters</strong>.</p>
<p>thanks http://www.blogsdna.com/754/top-5-online-htaccess-mod-rewrite-rules-generator-website-blogs.htm</p>
]]></content:encoded>
			<wfw:commentRss>http://www.prosoxi.gr/2010/03/01/top-5-online-htaccess-mod-rewrite-rules-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.htaccess upload_max_filesize ini_set()</title>
		<link>http://www.prosoxi.gr/2010/01/25/htaccess-upload_max_filesize-ini_set/</link>
		<comments>http://www.prosoxi.gr/2010/01/25/htaccess-upload_max_filesize-ini_set/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 15:55:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.prosoxi.gr/?p=956</guid>
		<description><![CDATA[I m PHP 5.2.0 / Apache and I can&#8217;t access php.ini I try to update .htaccess and added php_value upload_max_filesize &#8220;25M&#8221; php_value post_max_size &#8220;25M&#8221; However it will give me &#8220;Internal Server Error&#8221; From the log file , i can see the error msg [Mon Jan 22 14:57:57 2007] [alert] [client 127.0.0.1] C:/work/www/Joomla-1.0.11_eCommerceEdition_VM-1.0.7/.htaccess: Invalid command &#8216;php_value&#8217;,]]></description>
			<content:encoded><![CDATA[<p>I m PHP 5.2.0 / Apache<br />
and I can&#8217;t access php.ini</p>
<p>I try to update .htaccess<br />
and added<br />
php_value upload_max_filesize &#8220;25M&#8221;<br />
php_value post_max_size &#8220;25M&#8221;</p>
<p>However it will give me &#8220;Internal Server Error&#8221;<span id="more-956"></span></p>
<blockquote>
<blockquote><p>From the log file , i can see the error msg</p></blockquote>
</blockquote>
<p>[Mon Jan 22 14:57:57 2007] [alert] [client 127.0.0.1]<br />
C:/work/www/Joomla-1.0.11_eCommerceEdition_VM-1.0.7/.htaccess: Invalid<br />
command &#8216;php_value&#8217;, perhaps mis-spelled or defined by a module not<br />
included in the server configuration, referer:<br />
<a rel="nofollow" href="http://joomla/administrator/index2.php?option=com_docman&amp;section=config">http://joomla/administrator/index2.php?option=com_docman&amp;section=config</a></p>
<p>so I searched on web and try again.. and update the .htaccess</p>
<p>&lt;IfModule mod_php5.c&gt;<br />
php_value max_execution_time &#8220;60&#8243;<br />
php_value upload_max_filesize &#8220;25M&#8221;<br />
php_value post_max_size &#8220;25M&#8221;<br />
&lt;/IfModule&gt;</p>
<p>No Error msg, but nothing change.</p>
<p>then I searched again &#8230;.</p>
<p>updated php code &#8211; ini_set()</p>
<p>print &#8220;b4 &#8220;.ini_get(&#8216;upload_max_filesize&#8217;);<br />
ini_set(&#8220;upload_max_filesize&#8221; , &#8220;10M&#8221;);<br />
print &#8220;&lt;br/&gt;after &#8220;.ini_get(&#8216;upload_max_filesize&#8217;);</p>
<p>which I got the same &#8220;2M&#8221; from the php code</p>
]]></content:encoded>
			<wfw:commentRss>http://www.prosoxi.gr/2010/01/25/htaccess-upload_max_filesize-ini_set/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add Trailing Slash to the End of the URL with .htaccess Rewrite Rules</title>
		<link>http://www.prosoxi.gr/2009/08/03/add-trailing-slash-to-the-end-of-the-url-with-htaccess-rewrite-rules/</link>
		<comments>http://www.prosoxi.gr/2009/08/03/add-trailing-slash-to-the-end-of-the-url-with-htaccess-rewrite-rules/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 15:19:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.htaccess]]></category>

		<guid isPermaLink="false">http://www.prosoxi.gr/?p=733</guid>
		<description><![CDATA[For a website that has URLs that end with a slash (/), it’s a good practice to ensure that all url links been parsed by the web server ended with trailing slash, even if visitors forget to enter the ending slash. This avoid visitors been served with 404 Page Not Found or Page Cannot be Displayed]]></description>
			<content:encoded><![CDATA[<p style="line-height: 1.5em; text-align: justify;">For a website that has URLs that end with a slash (/), it’s a good practice to ensure that all url links been parsed by the web <a id="KonaLink0" style="color: blue !important; text-decoration: underline !important; cursor: pointer; font-family: verdana; background-image: none !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: transparent !important; text-transform: none !important; display: inline !important; font-variant: normal; top: 0px; right: 0px; bottom: 0px; left: 0px; position: static; background-position: initial initial !important; padding: 0px !important; margin: 0px; border: 0px !important none !important transparent !important;" href="http://www.mydigitallife.info/2007/03/19/add-trailing-slash-to-the-end-of-the-url-with-htaccess-rewrite-rules/#" target="undefined"><span style="color: blue !important; font-weight: normal; font-size: 13px; position: static;"><span style="border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: blue !important; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; font-family: 'Trebuchet MS'; font-weight: normal; font-size: 13px; position: static; background-position: initial initial;">server</span></span></a> ended with trailing slash, even if visitors forget to enter the ending slash. This avoid visitors been served with 404 Page Not Found or Page Cannot be Displayed error as some <a id="KonaLink1" style="color: blue !important; text-decoration: underline !important; cursor: pointer; font-family: verdana; background-image: none !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: transparent !important; text-transform: none !important; display: inline !important; font-variant: normal; top: 0px; right: 0px; bottom: 0px; left: 0px; position: static; background-position: initial initial !important; padding: 0px !important; margin: 0px; border: 0px !important none !important transparent !important;" href="http://www.mydigitallife.info/2007/03/19/add-trailing-slash-to-the-end-of-the-url-with-htaccess-rewrite-rules/#" target="undefined"><span style="color: blue !important; font-weight: normal; font-size: 13px; position: static;"><span style="border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: blue !important; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; font-family: 'Trebuchet MS'; font-weight: normal; font-size: 13px; position: static; background-position: initial initial;">web</span><span style="border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: blue !important; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; font-family: 'Trebuchet MS'; font-weight: normal; font-size: 13px; position: static; background-position: initial initial;">servers</span></span></a> treat links without trailing slash as a file name instead of directory, and thus unable to locate the <a id="KonaLink2" style="color: blue !important; text-decoration: underline !important; cursor: pointer; font-family: verdana; background-image: none !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: transparent !important; text-transform: none !important; display: inline !important; font-variant: normal; top: 0px; right: 0px; bottom: 0px; left: 0px; position: static; background-position: initial initial !important; padding: 0px !important; margin: 0px; border: 0px !important none !important transparent !important;" href="http://www.mydigitallife.info/2007/03/19/add-trailing-slash-to-the-end-of-the-url-with-htaccess-rewrite-rules/#" target="undefined"><span style="color: blue !important; font-weight: normal; font-size: 13px; position: static;"><span style="border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: blue !important; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; font-family: 'Trebuchet MS'; font-weight: normal; font-size: 13px; position: static; background-position: initial initial;">documents</span></span></a>. It also eliminates the possibility that both pages with same content, one with slash at the end and another without, been viewed by <a id="KonaLink3" style="color: blue !important; text-decoration: underline !important; cursor: pointer; font-family: verdana; background-image: none !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: transparent !important; text-transform: none !important; display: inline !important; font-variant: normal; top: 0px; right: 0px; bottom: 0px; left: 0px; position: static; background-position: initial initial !important; padding: 0px !important; margin: 0px; border: 0px !important none !important transparent !important;" href="http://www.mydigitallife.info/2007/03/19/add-trailing-slash-to-the-end-of-the-url-with-htaccess-rewrite-rules/#" target="undefined"><span style="color: blue !important; font-weight: normal; font-size: 13px; position: static;"><span style="border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: blue !important; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; font-family: 'Trebuchet MS'; font-weight: normal; font-size: 13px; position: static; background-position: initial initial;">search </span><span style="border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: blue !important; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; font-family: 'Trebuchet MS'; font-weight: normal; font-size: 13px; position: static; background-position: initial initial;">engines</span></span></a> as duplicate content.</p>
<p>As an example, all hits to http://www.mydigitallife.info/contact should be redirect to http://www.mydigitallife.info/contact/.<span id="more-733"></span>
</p>
<p style="line-height: 1.5em; text-align: justify;">Most web server, including the popular Apache HTTPD web server supports mod_rewrite module where rules can be set in .htaccess file in order to redirect to add trailing slash to the URLs that does not already have one.</p>
<p style="line-height: 1.5em; text-align: justify;">The following code can be put in .htaccess to <a id="KonaLink4" style="color: blue !important; text-decoration: underline !important; cursor: pointer; font-family: verdana; background-image: none !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: transparent !important; text-transform: none !important; display: inline !important; font-variant: normal; top: 0px; right: 0px; bottom: 0px; left: 0px; position: static; background-position: initial initial !important; padding: 0px !important; margin: 0px; border: 0px !important none !important transparent !important;" href="http://www.mydigitallife.info/2007/03/19/add-trailing-slash-to-the-end-of-the-url-with-htaccess-rewrite-rules/#" target="undefined"><span style="color: blue !important; font-weight: normal; font-size: 13px; position: static;"><span style="border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: blue !important; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; font-family: 'Trebuchet MS'; font-weight: normal; font-size: 13px; position: static; background-position: initial initial;">redirect </span><span style="border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: blue !important; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; font-family: 'Trebuchet MS'; font-weight: normal; font-size: 13px; position: static; background-position: initial initial;">URL</span></span></a> without trailing slash to URL with trailing slash:</p>
<p style="line-height: 1.5em; text-align: justify;">RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_URI} !index.php<br />
RewriteCond %{REQUEST_URI} !(.*)/$<br />
RewriteRule ^(.*)$ http://domain.com/$1/ [L,R=301]
</p>
<p style="line-height: 1.5em; text-align: justify;">or</p>
<p style="line-height: 1.5em; text-align: justify;">RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_URI} !\..+$<br />
RewriteCond %{REQUEST_URI} !/$<br />
RewriteRule (.*) http://www.mydigitallife.info/$1/ [R=301,L]
</p>
<p style="line-height: 1.5em; text-align: justify;">or</p>
<p style="line-height: 1.5em; text-align: justify;">RewriteEngine On<br />
RewriteBase /<br />
RewriteRule ^([a-zA-Z0-9]+)/$ /$1 [L]<br />
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([a-zA-Z0-9]+)<br />
RewriteRule ^([a-zA-Z0-9]+)$ /%1/? [R=301,L]
</p>
<p style="line-height: 1.5em; text-align: justify;">In you’re using CMS or blog such as <a id="KonaLink6" style="color: blue !important; text-decoration: underline !important; cursor: pointer; font-family: verdana; background-image: none !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: transparent !important; text-transform: none !important; display: inline !important; font-variant: normal; top: 0px; right: 0px; bottom: 0px; left: 0px; position: static; background-position: initial initial !important; padding: 0px !important; margin: 0px; border: 0px !important none !important transparent !important;" href="http://www.mydigitallife.info/2007/03/19/add-trailing-slash-to-the-end-of-the-url-with-htaccess-rewrite-rules/#" target="undefined"><span style="color: blue !important; font-weight: normal; font-size: 13px; position: static;"><span style="border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: blue !important; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; font-family: 'Trebuchet MS'; font-weight: normal; font-size: 13px; position: static; background-position: initial initial;">WordPress</span></span></a> that allows custom URL structure for permalinks, especially for search engine optimization (SEO), the above code should come before the block of rewrite conditions and rules for URL customization for the <a id="KonaLink5" style="color: blue !important; text-decoration: underline !important; cursor: pointer; font-family: verdana; background-image: none !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: transparent !important; text-transform: none !important; display: inline !important; font-variant: normal; top: 0px; right: 0px; bottom: 0px; left: 0px; position: static; background-position: initial initial !important; padding: 0px !important; margin: 0px; border: 0px !important none !important transparent !important;" href="http://www.mydigitallife.info/2007/03/19/add-trailing-slash-to-the-end-of-the-url-with-htaccess-rewrite-rules/#" target="undefined"><span style="color: blue !important; font-weight: normal; font-size: 13px; position: static;"><span style="border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: blue !important; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; font-family: 'Trebuchet MS'; font-weight: normal; font-size: 13px; position: static; background-position: initial initial;">CMS</span></span></a> or blog platform.</p>
<p style="line-height: 1.5em; text-align: justify;"><strong>Brief explaination of the rewrite code to add trailing slash to URL</strong></p>
<p style="line-height: 1.5em; text-align: justify;">RewriteEngine On – This line enables the runtime rewriting engine based on mod_rewrite module of Apache.</p>
<p style="line-height: 1.5em; text-align: justify;">RewriteBase / – This line sets the current page root directory as base URL for per-directory rewrites.</p>
<p style="line-height: 1.5em; text-align: justify;">RewriteCond %{REQUEST_FILENAME} !-f – This line excludes all URLs pointing to existed files from been added with trailing slash again. Directories cannot be excluded as this would exclude the rewrite behavior for existing directories.</p>
<p style="line-height: 1.5em; text-align: justify;">RewriteCond %{REQUEST_URI} !index.php – This line is optional, and will excludes a sample URL (in this case, index.php) that <a id="KonaLink7" style="color: blue !important; text-decoration: underline !important; cursor: pointer; font-family: verdana; background-image: none !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: transparent !important; text-transform: none !important; display: inline !important; font-variant: normal; top: 0px; right: 0px; bottom: 0px; left: 0px; position: static; background-position: initial initial !important; padding: 0px !important; margin: 0px; border: 0px !important none !important transparent !important;" href="http://www.mydigitallife.info/2007/03/19/add-trailing-slash-to-the-end-of-the-url-with-htaccess-rewrite-rules/#" target="undefined"><span style="color: blue !important; font-weight: normal; font-size: 13px; position: static;"><span style="border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: blue !important; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; font-family: 'Trebuchet MS'; font-weight: normal; font-size: 13px; position: static; background-position: initial initial;">users</span></span></a> do not want it to be rewritten. Remove this line if not necessary.</p>
<p style="line-height: 1.5em; text-align: justify;">RewriteCond %{REQUEST_URI} !\..+$ – Specify that the URL does not contain any . (dot) to exclude reference to file.</p>
<p style="line-height: 1.5em; text-align: justify;">RewriteCond %{REQUEST_URI} !(.*)/$ – This line determines which URL doesn’t contain a trailing slash</p>
<p style="line-height: 1.5em; text-align: justify;">RewriteRule ^(.*)$ http://www.domain.com/$1/ [L,R=301] – This line process URL without trailing slash that has passed conditions set above, by appending a trailing slash and then redirect with 301 or permanent redirect status to the new URL. L mean this is the last line to process and the rewrite process can be terminated. Remember to replace the www.domain.com with your own domain name.</p>
<p style="line-height: 1.5em; text-align: justify;"><strong>Brief explaination for second set of rewrite rules and rule conditions</strong></p>
<p style="line-height: 1.5em; text-align: justify;">RewriteRule ^([a-zA-Z0-9]+)/$ /$1 [L] – This line terminates the trailing slash appending rewrite process if the URL already contains trailing slash.</p>
<p style="line-height: 1.5em; text-align: justify;">RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([a-zA-Z0-9]+) – This line determines request that does not ends with trailing slash.</p>
<p style="line-height: 1.5em; text-align: justify;">RewriteRule ^([a-zA-Z0-9]+)$ /%1/? [R=301,L] – This line append a slash to the end of URI and perform a 301 permanent redirect to the new URL with trailing slash, and terminate the rewrite block.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.prosoxi.gr/2009/08/03/add-trailing-slash-to-the-end-of-the-url-with-htaccess-rewrite-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Password Protecting Your Pages with htaccess</title>
		<link>http://www.prosoxi.gr/2009/07/30/password-protecting-your-pages-with-htaccess/</link>
		<comments>http://www.prosoxi.gr/2009/07/30/password-protecting-your-pages-with-htaccess/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 05:42:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.htaccess]]></category>

		<guid isPermaLink="false">http://www.prosoxi.gr/?p=724</guid>
		<description><![CDATA[Creating the password file The first step is to create a simple text file that will store your username and password, separated by a colon (:). The small catch is that the password must be encrypted. Luckily, there are many free web-based utilities that will encrypt the password for you. Try one of these: 4WebHelp&#8217;s online]]></description>
			<content:encoded><![CDATA[<h2 style="font-family: arial, helvetica, verdana, sans-serif; line-height: 1.25em; font-weight: bold; margin-top: 30px; margin-right: 0px; margin-bottom: 12px; margin-left: 0px; color: #f46a05; font-size: 1.3em;">Creating the password file</h2>
<p style="font-family: arial, helvetica, verdana, sans-serif; font-weight: normal; margin-top: 0px; margin-bottom: 14px;">The first step is to create a simple text file that will store your username and password, separated by a colon (<code style="font-size: 1.2em;">:</code>). The small catch is that the password must be <em>encrypted</em>. Luckily, there are many free web-based utilities that will encrypt the password for you. Try one of these:</p>
<ul style="line-height: 1.2em; margin-top: 0px; margin-left: 0px; padding-left: 0px; list-style-type: circle; list-style-image: url(http://www.elated.com/res/Image/misc/li_bullet.gif); list-style-position: outside;">
<li style="margin-left: 1.4em; margin-top: 0px; margin-bottom: 4px;"><a style="font-family: arial, helvetica, verdana, sans-serif; text-decoration: none; color: #0066b7;" href="http://www.4webhelp.net/us/password.php">4WebHelp&#8217;s online .htpasswd encryption tool</a></li>
<li style="margin-left: 1.4em; margin-top: 0px; margin-bottom: 4px;"><a style="font-family: arial, helvetica, verdana, sans-serif; text-decoration: none; color: #0066b7;" href="http://shop.alterlinks.com/htpasswd/htpasswd.php">Alterlinks .htaccess password generator</a></li>
<li style="margin-left: 1.4em; margin-top: 0px; margin-bottom: 4px;"><a style="font-family: arial, helvetica, verdana, sans-serif; text-decoration: none; color: #0066b7;" href="http://www.htmlite.com/HTA006a.php">htmlite&#8217;s htpasswd encryption page</a></li>
</ul>
<p style="font-family: arial, helvetica, verdana, sans-serif; font-weight: normal; margin-top: 0px; margin-bottom: 14px;">Simply enter your desired username and password in one of these pages and submit the form. You&#8217;ll get back a string similar to the following:<span id="more-724"></span></p>
<pre style="background-image: url(http://www.elated.com/res/Image/misc/samp_box_bg.jpg); background-repeat: no-repeat; background-attachment: scroll; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: #f7f7e6; margin-top: 30px; margin-right: auto; margin-bottom: 30px; margin-left: auto; padding-top: 25px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-family: 'Courier New', Courier, serif; width: auto; overflow-x: auto; overflow-y: auto; background-position: 0px 0px;"><samp style="font-size: 1.2em;">
fred:p29cmnwl4a0et
</samp></pre>
<p style="font-family: arial, helvetica, verdana, sans-serif; font-weight: normal; margin-top: 0px; margin-bottom: 14px;">Now, open up your favourite text editor (e.g. Notepad or TextEdit), then copy and paste the username/password string into the editor. Save the file and call it <code style="font-size: 1.2em; color: #773333;">.htpasswd</code>.</p>
<p style="font-family: arial, helvetica, verdana, sans-serif; font-weight: normal; margin-top: 0px; margin-bottom: 14px;">Next, upload this file to your website. Make sure you place it outside the Web root of your site if possible, as you don&#8217;t want just anyone to be able to view the file! For example, place it above your <code style="font-size: 1.2em; color: #773333;">public_html</code> or <code style="font-size: 1.2em; color: #773333;">htdocs</code> folder. (Having said this, Apache is often set up by default to block web-based access to files beginning with <code style="font-size: 1.2em; color: #773333;">.ht</code>. Better safe than sorry though!)</p>
<p style="font-family: arial, helvetica, verdana, sans-serif; font-weight: normal; margin-top: 0px; margin-bottom: 14px;">If you can&#8217;t place your <code style="font-size: 1.2em; color: #773333;">.htpasswd</code> file outside your Web root, name it something that&#8217;s not easily guessable &#8211; for example, <code style="font-size: 1.2em; color: #773333;">.htxuymwp</code> &#8211; so that people won&#8217;t be able to find it easily. (In addition, it helps to start the filename with<code style="font-size: 1.2em; color: #773333;">.ht</code>; as mentioned earlier, Apache usually blocks access to files starting with <code style="font-size: 1.2em; color: #773333;">.ht</code>.)</p>
<h3 style="font-family: arial, helvetica, verdana, sans-serif; line-height: 1.25em; font-weight: normal; margin-top: 25px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; color: #f46a05; font-size: 1.2em;">Alternative: Creating the password file using <code style="font-size: 1.2em;">htpasswd</code></h3>
<p style="font-family: arial, helvetica, verdana, sans-serif; font-weight: normal; margin-top: 0px; margin-bottom: 14px;">If you have SSH access to your web server (or you&#8217;re running Apache on a local machine), you can encrypt your password and add it to your password file in one go by using the <code style="font-size: 1.2em; color: #773333;">htpasswd</code> utility that comes with Apache. Simply SSH to your server or open up a terminal window on your local machine, <kbd style="color: #337733; font-size: 1.2em;">cd</kbd> to the folder where you want to create your password file, and type:</p>
<p><kbd style="color: #337733; font-size: 1.2em;">htpasswd -c .htpasswd fred</kbd></p>
<p style="font-family: arial, helvetica, verdana, sans-serif; font-weight: normal; margin-top: 20px; margin-bottom: 14px;">(where <kbd style="color: #337733; font-size: 1.2em;">fred</kbd> is the username you want to use). You&#8217;ll be prompted to enter and retype your password, then the<code style="font-size: 1.2em; color: #773333;">.htpasswd</code> file will be created for you.</p>
<h2 style="font-family: arial, helvetica, verdana, sans-serif; line-height: 1.25em; font-weight: bold; margin-top: 30px; margin-right: 0px; margin-bottom: 12px; margin-left: 0px; color: #f46a05; font-size: 1.3em;">Creating the <code style="font-size: 1.2em;">.htaccess</code> file</h2>
<p style="font-family: arial, helvetica, verdana, sans-serif; font-weight: normal; margin-top: 0px; margin-bottom: 14px;">Now that you have created and uploaded your password file, you need to tell Apache to use it to protect your page(s) or site. This is what your <code style="font-size: 1.2em; color: #773333;">.htaccess</code> file will do.</p>
<p style="font-family: arial, helvetica, verdana, sans-serif; font-weight: normal; margin-top: 0px; margin-bottom: 14px;">Open your text editor again, create a new file, and save it as <code style="font-size: 1.2em; color: #773333;">.htaccess</code>.</p>
<h3 style="font-family: arial, helvetica, verdana, sans-serif; line-height: 1.25em; font-weight: normal; margin-top: 25px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; color: #f46a05; font-size: 1.2em;">Protecting a folder</h3>
<p style="font-family: arial, helvetica, verdana, sans-serif; font-weight: normal; margin-top: 0px; margin-bottom: 14px;">To password protect a folder on your site, you need to put the following code in your <code style="font-size: 1.2em; color: #773333;">.htaccess</code> file:</p>
<pre style="background-image: url(http://www.elated.com/res/Image/misc/code_box_bg.jpg); background-repeat: no-repeat; background-attachment: scroll; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: #f7f7e6; margin-top: 30px; margin-right: auto; margin-bottom: 30px; margin-left: auto; padding-top: 25px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-family: 'Courier New', Courier, serif; width: auto; overflow-x: auto; overflow-y: auto; background-position: 0px 0px;"><code style="font-size: 1.2em;">
AuthUserFile <var>/full/path/to/.htpasswd</var>
AuthType Basic
AuthName "My Secret Folder"
Require valid-user
</code></pre>
<p style="font-family: arial, helvetica, verdana, sans-serif; font-weight: normal; margin-top: 0px; margin-bottom: 14px;"><var>/full/path/to/.htpasswd</var> should be the full path to the <code style="font-size: 1.2em; color: #773333;">.htpasswd</code> file that you uploaded earlier. The full path is the path to the file from the Web server&#8217;s volume root &#8211; for example, <code style="font-size: 1.2em; color: #773333;">/home/username/.htpasswd</code> or<code style="font-size: 1.2em; color: #773333;">C:\wwwroot\username\.htpasswd</code>. (If you&#8217;re not sure of the full path to your site or home directory, ask your Web hosting company for this info.)</p>
<p style="font-family: arial, helvetica, verdana, sans-serif; font-weight: normal; margin-top: 0px; margin-bottom: 14px;">The above <code style="font-size: 1.2em; color: #773333;">.htaccess</code> file will password protect all files in the folder that it is placed in, and all sub-folders under that folder too. So if you wanted to password protect your entire site, you would place the <code style="font-size: 1.2em; color: #773333;">.htaccess</code> file in your Web root folder.</p>
<h3 style="font-family: arial, helvetica, verdana, sans-serif; line-height: 1.25em; font-weight: normal; margin-top: 25px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; color: #f46a05; font-size: 1.2em;">Protecting a file</h3>
<p style="font-family: arial, helvetica, verdana, sans-serif; font-weight: normal; margin-top: 0px; margin-bottom: 14px;">To password protect just a single file in a folder, use the following <code style="font-size: 1.2em; color: #773333;">.htaccess</code> file:</p>
<pre style="background-image: url(http://www.elated.com/res/Image/misc/code_box_bg.jpg); background-repeat: no-repeat; background-attachment: scroll; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: #f7f7e6; margin-top: 30px; margin-right: auto; margin-bottom: 30px; margin-left: auto; padding-top: 25px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-family: 'Courier New', Courier, serif; width: auto; overflow-x: auto; overflow-y: auto; background-position: 0px 0px;"><code style="font-size: 1.2em;">
AuthUserFile /full/path/to/.htpasswd
AuthType Basic
AuthName "My Secret Page"

&lt;Files "mypage.html"&gt;
  Require valid-user
&lt;/Files&gt;

</code></pre>
<p style="font-family: arial, helvetica, verdana, sans-serif; font-weight: normal; margin-top: 0px; margin-bottom: 14px;">This will password protect just the <code style="font-size: 1.2em; color: #773333;">mypage.html</code> file in the folder where you put the <code style="font-size: 1.2em; color: #773333;">.htaccess</code> file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.prosoxi.gr/2009/07/30/password-protecting-your-pages-with-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Php, MySql, .htaccess: friendly urls</title>
		<link>http://www.prosoxi.gr/2009/07/26/php-mysql-htaccess-friendly-urls/</link>
		<comments>http://www.prosoxi.gr/2009/07/26/php-mysql-htaccess-friendly-urls/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 16:26:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.prosoxi.gr/2009/07/26/php-mysql-htaccess-friendly-urls/</guid>
		<description><![CDATA[Php, MySql, .htaccess: friendly urls There are a lot of tutorials that show how to change an address like: www.mysite.com/products.php?product_id=1234 into others like: www.mysite.com/products/1234 www.mysite.com/products/1234.html In this article I’d like to go one step forward and to create something like: www.mysite.com/easy-to-remember-product-name www.mysite.com/easy-to-remember-product-name.html How-To and Contraindications Switching from an address like the first one to the]]></description>
			<content:encoded><![CDATA[<h2>Php, MySql, .htaccess: friendly urls</h2>
<p>There are a lot of tutorials that show how to change an address like:</p>
<ul>
<li><em>www.mysite.com/products.php?product_id=1234</em></li>
</ul>
<p>into others like:</p>
<ul>
<li><em>www.mysite.com/products/1234</em></li>
<li><em>www.mysite.com/products/1234.html</em></li>
</ul>
<p>In this article I’d like to go one step forward and to create something like:</p>
<ul>
<li><em>www.mysite.com/easy-to-remember-product-name</em></li>
<li><em>www.mysite.com/easy-to-remember-product-name.html<span id="more-723"></span></em></li>
</ul>
<p><strong>How-To and Contraindications</strong></p>
<p>Switching from an address like the first one to the secon ones is <strong>search engine necessary</strong>, because SE spiders often don’t crawl correctly our dynamic urls. Switching to the third ones is much better, because it’s a <strong>search engine friendlier</strong>, and it’s <strong>human friendly</strong> too.</p>
<p>Now, I think we all agree that we should <strong>change our dynamic urls</strong> into the last ones, but the goal is to make it without modifying, or at least without modifying too heavily our web application. If our php script works with a query for product_id, and product_id is the unique, autoincremental key of our mysql database, we have to rewrite our urls without losing the possibility for our script to work in its original way.</p>
<p>That is <strong>the way WordPress works</strong>: a function that allows the user to choose the preferred format for the urls. In this tutorial, we replicate – in a very simplier way – that tool.</p>
<p><strong>How the system works</strong></p>
<p>My solution – with downloadable example – uses php and mysql to manage the content and create the urls, and Apache’s server mod_rewrite module to rewrite the addresses. We assume to be on a linux server and that our app is <strong>php and mysql</strong> based.</p>
<p>We have 2 tables in our mysql db:</p>
<p><strong>News</strong> table contains the articles, with the columns id, title, article and <strong>slug</strong>, where slug contains the sanityzed title, that is a title like: “That’s an easy mod_rewrite tutorial” becomes “thats-an-easy-mod-rewrite-tutorial”.<br />
The script, normally, queries the db for the id, but we, through php, will find the related slug. Then we rewrite the url through mod_rewrite.</p>
<p><strong>Options</strong> table contains id, name and value of the options, that is, in this example, permalinks yes/no. If permalinks are off, php will query the db for the id, and the url format will be: index.php?id=x. If permalinks are on, php will query mysql for the slug, and mod_rewrite will rewrite the url in format: rewritten-url-with-php-and-mod-rewrite.</p>
<p><strong>Example</strong></p>
<p>A working example is available at:<br />
<a href="http://www.gruppomodulo.it/lavori/esempi/mod-rewrite-php-htaccess-tutorial/">gruppomodulo.it/lavori/esempi/mod-rewrite-php-htaccess-tutorial/</a></p>
<p>Also downloadable in .zip format at:<a href="http://www.gruppomodulo.it/lavori/esempi/mod-rewrite-php-htaccess-tutorial/ex.zip"><br />
gruppomodulo.it/lavori/esempi/mod-rewrite-php-htaccess-tutorial/ex.zip</a></p>
<p>Example includes following files:</p>
<ul>
<li><strong>.htaccess</strong><br />
Very simple .htaccess for mod_rewrite, that transforms the url from ?slug=rewritten-url to /rewritten-url.<br />
If permalinks are off, url format will be ?id=x, and there will be no rewrite.</li>
</ul>
<ul>
<li><strong>options.php</strong><br />
The file with the basic tool to switch on/off the permalinks</li>
</ul>
<ul>
<li><strong>single.php</strong> and <strong>index.php</strong><br />
Show site contents.</li>
</ul>
<ul>
<li><strong>functions.php </strong><br />
Contains the function that generates the urls (rewritten or not, depending on permalinks selected status) and the function that gets the articles from mysql database.</li>
</ul>
<ul>
<li>Zip file also includes the .sql file to recreate the <strong>example datatabase</strong>.</li>
</ul>
<p>thanks http://www.lucabiagini.com/2008/03/php-mysql-htaccess-friendly-urls/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.prosoxi.gr/2009/07/26/php-mysql-htaccess-friendly-urls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.htaccess Generator</title>
		<link>http://www.prosoxi.gr/2009/04/03/htaccess-generator/</link>
		<comments>http://www.prosoxi.gr/2009/04/03/htaccess-generator/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 11:01:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.prosoxi.gr/?p=549</guid>
		<description><![CDATA[.htaccess File Wizard The .htaccess is a simple method that allows you to customise the way the webserver works on a per directory basis. The .htaccess file is a simple ASCII text file, which when placed in a certain directory in your webspace, will cause the webserver to use that configuration on all files in]]></description>
			<content:encoded><![CDATA[<table border="0" cellpadding="5" width="95%">
<tbody>
<tr>
<td align="center" bgcolor="#C0C0C0"><strong>.htaccess File Wizard</strong></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="10" width="95%">
<tbody>
<tr>
<td>The .htaccess is a simple method that allows you to customise the way the webserver works on a per directory basis. The .htaccess file is a simple ASCII text file, which when placed in a certain directory in your webspace, will cause the webserver to use that configuration on all files in that directory and any files in any subdirectories. </p>
<p>When you have finished creating your .htaccess code, click on the &#8220;Select All&#8221; button and copy (CTRL + C) and paste (CTRL + V) the code into a text editor and save the file as <strong>.htaccess</strong>. The .htaccess file should have the name &#8220;.htaccess&#8221; (all lowercase), and can either be created using a command line text editor when logged in using ssh or can be uploaded by ftp. </p>
<p><a href="http://developers.evrsoft.com/tools-htaccess-generator.shtml?htuser=asd&amp;htpassword=asd&amp;chtpassword=asd&amp;submit=Encode" target="_blank">more info </a></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.prosoxi.gr/2009/04/03/htaccess-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
