<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>mod_rewrite &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/mod_rewrite/</link>
	<description>Feed of posts on WordPress.com tagged "mod_rewrite"</description>
	<pubDate>Sat, 11 Oct 2008 05:13:07 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[[ANN] Nuovi articoli su Java e J2EE]]></title>
<link>http://megadix.wordpress.com/?p=154</link>
<pubDate>Fri, 03 Oct 2008 08:15:14 +0000</pubDate>
<dc:creator>megadix</dc:creator>
<guid>http://blog.megadix.it/2008/10/03/ann-nuovi-articoli-su-java-e-j2ee/</guid>
<description><![CDATA[Schedulare i job con Quartz e Spring
La schedulazione di procedure ricorrenti è una cartatteristica]]></description>
<content:encoded><![CDATA[<p><a href="http://www.megadix.it/node/78" target="_blank">Schedulare i job con Quartz e Spring</a></p>
<p>La schedulazione di procedure ricorrenti è una cartatteristica di molte applicazioni, soprattutto quelle di una certa complessità. In questo articolo vediamo come sia semplice integrare Quartz in applicazioni esistenti e che facciano uso dello Spring framework.</p>
<p><a href="http://www.megadix.it/node/79" target="_blank">UrlRewriteFilter - un mod_rewrite per le servlet</a></p>
<p>In questo articolo spiego come utilizzare UrlRewriteFilter, un utilissimo filtro che emula il comportamento di mod_rewrite, permettendo magie altrimenti molto difficili da realizzare "a mano"</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Urls Amigáveis com PHP]]></title>
<link>http://noaldo.wordpress.com/?p=28</link>
<pubDate>Mon, 22 Sep 2008 22:40:36 +0000</pubDate>
<dc:creator>noaldo</dc:creator>
<guid>http://noaldo.id.wordpress.com/2008/09/22/urls-amigaveis-com-php/</guid>
<description><![CDATA[E aê pessoal!
Hoje vamos falar desse tema que está tão comentado no mundo web.
Atualmente tanto s]]></description>
<content:encoded><![CDATA[<p>E aê pessoal!</p>
<p>Hoje vamos falar desse tema que está tão comentado no mundo web.</p>
<p>Atualmente tanto se fala em SEO, sistemas de busca, ranking, posicionamento em sistemas de busca, etc. Utilizar url amigáveis no seu site poderá ajudá-lo a atingir estes objetivos.</p>
<p>Mas e o que são urls amigáveis? Como identifico uma url amigável?</p>
<p>Vamos ao que interessa!</p>
<p>http://www.seusite.com.br/index.php?categoria=5&#38;pg=10  -&#62; url comum<br />
http://www.seusite.com.br/artigos/5/10/                            -&#62; url amigável?</p>
<p>Deu para perceber? É muito mais fácil para qualquer pessoa acessar a segunda opção, não acha? Pois bem, para os robôs de busca, também! Assim o conteúdo do seu site terá muito mais relevância para as palavras buscadas!</p>
<p>Existem algumas técnicas para obter estes resultados. Vou passar para vocês a que uso no meu dia-a-dia.</p>
<p>Para utlizar este método de "re-escrita da url" vamos precisar que o mod_rewrite do apache esteja ativado, para isto basta descomentar a linha abaixo no seu httpd.conf:</p>
<p>LoadModule rewrite_module modules/mod_rewrite.so</p>
<p>A técnica que vou mostrar para vocês já está bastante conhecida na internet, portanto não será difícil encontrar outros exemplos para isto.  Esta técnica utiliza o arquivo .htaccess e um arquivo php para direcionar o usuário para a página correta (não é redirecionamento).</p>
<p>Crie um arquivo chamado .htaccess e coloque o seguinte (explico as linhas nos comentários)</p>
<p><em><strong>&#60;IfModule mod_rewrite.c&#62;<br />
</strong><strong>#habilita o modulo Rewrite</strong></em><em><strong><br />
RewriteEngine On<br />
</strong><strong>#Indica qual é a pasta base do conteúdo do site</strong></em><em><strong><br />
RewriteBase /<br />
#Verifica se a url digitada é um arquivo caso seja para aqui</strong></em><em><strong><br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
#Verifica se a url digitada é uma pasta caso seja para aqui</strong></em><em><strong><br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
#Mostra o caminho completo do meu arquivo default.php - tratamento dos dados</strong></em><em><strong><br />
RewriteRule .(/)?$ /default.php<br />
&#60;/IfModule&#62;</strong></em></p>
<p>No seu arquivo default.php você deve colocar isto:</p>
<p><strong><em>&#60;?php<br />
//recupera num array o conteúdo passado na url<br />
$gets = explode("/",str_replace(strrchr($_SERVER["REQUEST_URI"], "?"), "", $_SERVER["REQUEST_URI"]));<br />
//Elimina o 1°  ítem pois está vazio</em></strong><br />
<strong><em>array_shift($gets);</em></strong></p>
<p><strong><em>//Verifica se é um arquivo existente<br />
if(file_exists($gets[0] . ".php")){<br />
//inclui o arquivo<br />
require ($gets[0] . ".php");</em></strong></p>
<p><strong><em>}else{<br />
//Caso contrário envia para a página base<br />
header("Location: /");<br />
}<br />
?&#62;</em></strong></p>
<p>Pronto, é isso aew! Agora é só testar! Utilizo isto frequentemente, e caso vocês não tenham percebido mas o próprio wordpress utiliza url amigáveis.<br />
Vlw, até a próxima!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[mod_rewrite]]></title>
<link>http://jacug.wordpress.com/2008/09/20/mod_rewrite/</link>
<pubDate>Sat, 20 Sep 2008 13:53:54 +0000</pubDate>
<dc:creator>jacug</dc:creator>
<guid>http://jacug.id.wordpress.com/2008/09/20/mod_rewrite/</guid>
<description><![CDATA[Od dawna miałem zamiar zabrać się za naukę mod_rewrite, ale jakoś zawsze nie było czasu, albo ]]></description>
<content:encoded><![CDATA[<p>Od dawna miałem zamiar zabrać się za naukę mod_rewrite, ale jakoś zawsze nie było czasu, albo artykuły w sieci były za długie... Dziś się udało - znalazłem pod adresem http://sf.jogger.pl/2007/05/02/mod-rewrite-w-przykladach/ mini-kurs który pozwolił mi to zrozumieć. polecam</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Url-Rewrite für Umlaute und Sonderbuchstaben in ganz Europa]]></title>
<link>http://illu23.wordpress.com/?p=31</link>
<pubDate>Sun, 14 Sep 2008 19:08:00 +0000</pubDate>
<dc:creator>illu23</dc:creator>
<guid>http://illu23.id.wordpress.com/2008/09/14/url-rewrite-umlaute-europa/</guid>
<description><![CDATA[Ewig auf der Suche, hier eine kleine Liste, wie man für die Ländereigenen Umlaute und besonderen B]]></description>
<content:encoded><![CDATA[<p>Ewig auf der Suche, hier eine kleine Liste, wie man für die Ländereigenen Umlaute und besonderen Buchstaben richtig geformte Url-Umschreibungen findet.<br />
Ich weiß, mittlerweile funktionieren auch die Umlaute in den Browsern-Adresszeilen gescheit, aber seit meiner späten Jugend habe ich eingetrichtert bekommen, nur den einfachsten Zeichenschriftsatz zu nutzen.</p>
<p>Bei Wikipedia sieht es doch ganz schön aus: <a href="http://de.wikipedia.org/wiki/Gürtel" target="_blank" rel="nofollow">http://de.wikipedia.org/wiki/Gürtel</a></p>
<p>Das würde bei mir rauskommen: www.domain.de/Guertel.htm</p>
<p>Nun ist man aber manchmal damit konfrontiert, die Url für Fremdsprachen 'schön' zu schreiben. Wie werden denn nun solche Sonderzeichen im Ausland <em>umgeschrieben</em>? An dieser Stelle eine kleine Sammlung:</p>
<p><strong>Deutschland:</strong></p>
<table border="0" width="160">
<tbody>
<tr>
<th>ä</th>
<th>ö</th>
<th>ü</th>
<th>ß</th>
</tr>
<tr>
<td>ae</td>
<td>oe</td>
<td>ue</td>
<td>ss</td>
</tr>
</tbody>
</table>
<p><strong>Frankreich:</strong></p>
<table border="0" width="80">
<tbody>
<tr>
<th>á, à</th>
<th>é, è</th>
</tr>
<tr>
<td>a</td>
<td>e</td>
</tr>
</tbody>
</table>
<p><strong>Dänemark:</strong></p>
<table border="0" width="120">
<tbody>
<tr>
<th>å</th>
<th>æ</th>
<th>ø</th>
</tr>
<tr>
<td>a</td>
<td>ae</td>
<td>oe</td>
</tr>
</tbody>
</table>
<p><strong>Ungarn:</strong><br />
...</p>
<p>Weitere Umlaute folgen, Vorschläge können einfach dazukommentiert werden.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[RewriteMap directive in .htaccess file problem?]]></title>
<link>http://savride.wordpress.com/?p=49</link>
<pubDate>Tue, 09 Sep 2008 14:51:49 +0000</pubDate>
<dc:creator>savride</dc:creator>
<guid>http://savride.id.wordpress.com/2008/09/09/rewritemap-directive-in-htaccess-file-problem/</guid>
<description><![CDATA[As written in Apache&#8217;s manual (Apache HTTP Server Version 2.2 Documentation):
RewriteMap Direc]]></description>
<content:encoded><![CDATA[<p>As written in Apache's manual (<a title="RewriteMap manual" href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritemap">Apache HTTP Server Version 2.2 Documentation</a>):</p>
<p><span style="color:#993300;">RewriteMap Directive<br />
<span style="color:#000000;">(...)<br />
<span style="color:#ff0000;">Context: server config, virtual host</span><br />
(...)</span></span></p>
<p>this directive can be set only as described, <span style="color:#ff0000;">not in .htaccess file</span>.</p>
<p><strong>But really.. there's  no problem. Solution for PHP.</strong></p>
<p><strong><span style="color:#000000;font-weight:normal;">To replace links like:</span></strong></p>
<p><span style="color:#339966;">http://www.com/index.php?fa=Shop.List&#38;directoryId=334&#38;subcat=f5a7&#38;view=fu</span>ll<br />
to<br />
<span style="color:#339966;">http://www.com/List,cable,tube,photo</span></p>
<p>A map file (should be hidden from browsers for the best) must contain some entrys ( values can be extracted from DataBase too ) i.e.:</p>
<p>File: <span style="color:#993300;">rewriteMap.inc</span></p>
<p><span style="color:#993300;">List<span style="white-space:pre;"> </span>Shop.List<br />
cable<span style="white-space:pre;"> </span>349<br />
tube<span style="white-space:pre;"> </span>f5a7<br />
photo<span style="white-space:pre;"> </span>full</span></p>
<p>Then create an example rule:</p>
<p><span style="color:#993300;">RewriteRule ^([A-Za-z0-9_\-]+)\.htm$ /index.php?urlsel=$1 [NC,L]</span></p>
<p>[NC,L] (if needed) means no casesensitive and Last rule.<br />
Condition <span style="color:#993300;">^([A-Za-z0-9_\-]+)\.htm$</span> specifies files with <span style="color:#888888;">letters</span>, <span style="color:#888888;">numbers</span> and <span style="color:#888888;">-</span> and <span style="color:#888888;">_</span> and included <span style="color:#888888;">.htm</span> suffix. </p>
<p>This rule takes us INTERNALLY to:</p>
<p><span style="color:#339966;">http://www.com/index.php?urlsel=$1</span></p>
<p>where <span style="color:#993300;">$_GET['urlsel'] is = "List,cable,tube,photo"</span></p>
<p>Now it can be processed and served.<br />
Yet it can better.<br />
Why not create <strong>shortest links as possible</strong>.</p>
<p>Instead of multiple parameter combinations, <span style="color:#993300;">rewriteMap.inc</span> can hold links already prepared for single locations or ready to use parameters for each single link.</p>
<p>Example file: <span style="color:#993300;">rewriteMap.inc</span></p>
<p><span style="color:#993300;">guitar   modelC3   param1   param2   param3   id1<br />
guitar   modelA3   param1   param2   param3   id2<br />
drum   modelSH   param1   praram2   param3   id3</span></p>
<p>URL entered: </p>
<p><span style="color:#339966;">http://www.com/guitar-modelC3.htm </span> </p>
<p>Rule invisible redirects us to:</p>
<p><span style="color:#339966;">http://www.com/index.php?urlsel=$1 <span style="color:#000000;">( user still sees http://www.com/guitar-modelC3.htm)</span></span></p>
<p>Inside of index.php <span style="color:#993300;">$_GET['urlsel'] is = "guitar-modelC3"</span>.<br />
File index.php reads a <span style="color:#993300;">rewriteMap.inc</span> - or gets data from DB.<br />
What's good that even if You don't secure this $_GET - nothing happens, cause there will be NO INDEX found, but depending of  solution You may want to secure it (I do and You can read some at my previous article  <a rel="bookmark" href="http://savride.wordpress.com/2008/06/22/secure-parphp-variables-_get-_post-wrapper-function/">Secure PHP variables $_GET, $_POST - wrapper function</a>).</p>
<p>Now data from <span style="color:#993300;">rewriteMap.inc</span> or <span style="color:#993300;">database</span> can be retrieved and put into control variables in script.<br />
Data from <span style="color:#993300;">rewriteMap.inc</span> can be converted to an associative array indexed with <span style="color:#008000;">keys</span> as follows:</p>
<p><span style="color:#993300;">array[] of array[]<br />
array[ </span><span style="color:#008000;">guitar-modelC3</span><span style="color:#993300;"> ] =&#62; array ([0] param1[1] param2 [2] param3 [3] id)</span></p>
<p>to simplify access.</p>
<p>Of course file <span style="color:#993300;"><span style="color:#993300;">rewriteMap.inc</span> s<span style="color:#000000;">hould be created dynamically by Your www/CMS engine, by hand only with small web services or in special cases.</span></span></p>
<p>With this solution and a hughe URL links count, You'll have to consider some efficiency optimizations. But i'm sure You know that if you reading this.</p>
<p> </p>
<p>Using data base engine to store rewriteMap data depends of created data base model.</p>
<p>And that's it.<br />
This is only workaround idea to .htaccess problem. Optimization, alternatives and security aspects are beside of  this blog entry.<br />
It works for me but  I do not take responsibility of any entry on this blog. Use it all at Your own risk.</p>
<p> </p>
<p>( I use comma instead of / to avoid special treatment for CSS, JS and other client side included files - we don't need that at this time )<br />
( About mod_rewrite and URL rewriting You can read a great article here: <a title="URL rewriting" href="http://www.sitepoint.com/article/guide-url-rewriting/">URL rewriting</a> )</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Cheat Sheets]]></title>
<link>http://allforweb.wordpress.com/?p=18</link>
<pubDate>Tue, 02 Sep 2008 10:42:34 +0000</pubDate>
<dc:creator>Landish</dc:creator>
<guid>http://allforweb.id.wordpress.com/2008/09/02/cheat-sheets/</guid>
<description><![CDATA[Well, in this post you can get some interesting things, here we have cheat sheets of PHP, CSS, HTML,]]></description>
<content:encoded><![CDATA[<p>Well, in this post you can get some interesting things, here we have cheat sheets of PHP, CSS, HTML, javascript and other good stuff, just read thes artilces full version</p>
<p><!--more-->Source: <a href="http://www.addedbytes.com/cheat-sheets/" target="_blank">http://www.addedbytes.com/cheat-sheets/</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Rewriting URL | احمي موقعك و اكتشف خدع المبرمجين]]></title>
<link>http://includ3r.wordpress.com/?p=40</link>
<pubDate>Mon, 01 Sep 2008 08:50:40 +0000</pubDate>
<dc:creator>includ3r</dc:creator>
<guid>http://includ3r.id.wordpress.com/2008/09/01/rewriting-url/</guid>
<description><![CDATA[السلام عليكم

أولا : رمضان مبارك للجميع و تقبل الله صيام]]></description>
<content:encoded><![CDATA[<p style="text-align:right;">السلام عليكم</p>
<p style="text-align:right;"><a href="http://includ3r.files.wordpress.com/2008/09/htaccess1.jpg"><img class="alignnone size-full wp-image-48" src="http://includ3r.wordpress.com/files/2008/09/htaccess1.jpg" alt="" width="300" height="300" /></a></p>
<p style="text-align:right;">أولا : رمضان مبارك للجميع و تقبل الله صيامنا و صالح اعمالنا باذن الله</p>
<p style="text-align:right;">موضوعنا لليوم هو عن</p>
<p style="text-align:right;">URL Rewriting</p>
<p style="text-align:right;"><!--more--></p>
<p style="text-align:right;">هو خاصية من الخواص التي يمكن تفعيلها عن طريق ملف htaccess</p>
<p style="text-align:right;">تسمح بتغيير هيئة الرابط لغرض رفع ترتيب الموقع في محركات البحث أو لمنع المتطفلين و المخترقين و لكن هل يمكن استعراض ثغرات الموقع إذا كان مفعل هذه الخاصية ؟ قبل الاجابة على هذا دعنا نتعرف على الـ URL REWRITING</p>
<h2 style="text-align:right;">مقدمة :</h2>
<p style="text-align:right;">تخيل أن مخترق يبحث في موقع عن ثغرة لكن لسوء الحظ كل الملفات .html و كالمعروف لغة</p>
<p style="text-align:right;">HTML تُعرف ان ليس لها ثغرة لأنها ليست لغة ديناميكية أو تفاعلية (في الحقيقة أظن أن ليس لها أية علاقة بالبرمجة :))</p>
<p style="text-align:right;">هل هذا يعني أن الـ .html غير مصاب بأي ثغرة ؟</p>
<p style="text-align:right;">خطاأأأأأأ لأن صاحب الموقع يمكنه التلاعب برابط صفحاته كما يشاء و هذا ما يسمى الـ</p>
<p style="text-align:right;">URL Rewriting..</p>
<h2 style="text-align:right;">نظرة على الـ Regex :</h2>
<p style="text-align:right;">إذا كنت تعرف الـ regex أو الـ regular expressions من قبل مع الـ php أو الـ perl فيمكنك تجاهل هذا الجزء .</p>
<p style="text-align:right;">بكل بساطة الـ regex هي عبارة عن نموذج يسمح بوصف سلسلة نصية .</p>
<p style="text-align:right;">هذه بعض القواعد الهامة في الـ regex :</p>
<ol style="text-align:right;">
<li>النقطة (.) تمثل أي حرف أو رقم أو رمز .</li>
<li>النجمة (*) تعني أن الرمز الذي قبلها يتكرر "صفر أو أكثر من مرة" يعني ليس الزامي مثال "tr*.txt" تقبل "t.txt" و "tr.txt" أو "trr.txt" أو "trrr.txt" الخ....</li>
<li>الزائد (+) يعني ان الرمز الذي قبله يعاد "مرة أو أكثر أي مرة على الأقل" مثال "tr+.txt" تقبل "tr.txt" و "trr.txt" أو "trrr.txt" و لكن لا تقبل "t.txt" فحذار !</li>
<li>العارضتان [] تمثلان صفا ما فـ [a-z] تمثل الحروف من a الى z صغيرة lowercase و الكبيرة [A-Z] و الأرقام [0-9] و الجميع [a-zA-Z0-9] و مثلا [ad] هي نفسها [abcd] و [adj] تعني الأحرف التالية a,d,j</li>
<li>^  تعني بداية السطر و $ تعني نهايته و لكن انتبه فــ /[a-z]^/ و /[a-z^]/ ليس نفس الشيء الأولى تعني أن يبدأ السطر بأحد الحروف من a الى z أما الثانية هي أن لا يبدأ السطر بأحد تلك الحروف و لهذا انتبهوا فمكان ^ له فرق</li>
<li>القوسان () يسمحان بأخذ النص الذي يقابل الـregex التي بداخلهما و النتيجة مخزنة في متغير $1 و اذا كان هنالك عدة أقواس فالمتغيرات هي $2 , $3 .....</li>
<li>الحاضنتان {} تمثلان التكرار و نستعمل الفاصلة , لتحديد البداي و النهاية فمثلا<br />
".{3,7}" تمثل أي رموز من ثلاثة إلى سبعة لأننا قلنا أن النقطة تكثل أي شيء</li>
<li>الـ backslash يستعمل يستعمل لعدم تشخيص رمز ما فماذا إذا أردنا البحث عن نقطة في النص هل نكتب "." خطأ لأن هذا يمثل أي رمز و لهذا نستعمل الـ backslash و العبارة الصحيحة هي "\."</li>
</ol>
<p style="text-align:right;">الآن بعد أن تعرفتم على قواعد الـ regex ينمكنك فهم هذه العبارة :</p>
<p style="text-align:right;">[a-z0-9]@[a-z0-9]\.[a-z0-9]{1,4}</p>
<p style="text-align:right;">طبعا ! هي عبارة عن ايميل !</p>
<p style="text-align:right;">و إذا احببتم الـ Regex فطبعا ستحبون البيرل فهي رائعة في التعامل معها</p>
<h2 style="text-align:right;">أساسيات URL Rewriting :</h2>
<p style="text-align:right;">URL Rewriting مسموح في الـ Apache من الوحدة (mod_rewrite) والتي تمكننا من اعادة كتابة الرابط . تتم كل الاعدادات في ملف <a href="http://fr.wikipedia.org/wiki/Htaccess" target="_blank">hatccess</a> الموجود داخل مجلد public_html عادة أي المجلد الرئيسي للموقع .</p>
<p style="text-align:right;">مثال :</p>
<blockquote>
<p style="text-align:left;">تشغيل الخاصية#<br />
RewriteEngine on</p>
<p style="text-align:left;">الاعدادات#<br />
RewriteRule photos-(.+)\.html     /index.php?page=photos&#38;p=$1    [L]<br />
RewriteRule index\.html           /index.php                     [L]<br />
RewriteRule ([a-z]+)\.html        /index.php?page=$1             [L]</p>
<p style="text-align:left;">
</blockquote>
<p style="text-align:right;">في السطر الأول شغلنا الخاصية و ألأسطر التالية قمنا بالاعدادات .</p>
<p style="text-align:right;">الآن سأشرح المثال الأول فقط</p>
<blockquote>
<p style="text-align:left;">RewriteRule photos-(.+)\.html     /index.php?page=photos&#38;p=$1    [L]</p>
</blockquote>
<p style="text-align:right;">في الحقيقة المستخدم يدخل الى هذا الرابط index.php?page=photos&#38;p=$1</p>
<p style="text-align:right;">مع العلم أن $1 هو متغير يمكن أن يكون 1 أو 55 أو album أو أي شيء ثم سيتم التحويل الى</p>
<p style="text-align:right;">photos-(.+)\.html</p>
<p style="text-align:right;">نلاحظ هنا (.+) و هذا يعني أي رمز يعاد على الأقل مرة واحدة ثم الـbackslach \. و هذا لعدم تشخيص النقطة كأي رمز بل سيتم تشخيصها كنقطة .!</p>
<p style="text-align:right;">و كل هذه العملية ستتم في سر أي أن المستخدم لا يعلم ما يجري فهو يظن أنه يتصفح في موقع كله بالـHtml</p>
<h2 style="text-align:right;">الأخطار و الثغرات :</h2>
<p style="text-align:right;">الكثير الكثير من الأصحاب المواقع يهملون موقعهم المصاب بعدة ثغرات و يقومون بتفعيل هذه الخاصية ظنا منهم أنها ستحميهم لكن المخترق إذا رأى مثلا news-2.html ثم news-13.html سيتفطن أن الرابط الحقيقي هو news.php?id=2 مثلا و في الحال سيقوم بالتالي news-and 1=1.html .</p>
<p style="text-align:right;">هذا في حال أن صاحب الموقع قد كتب في ملف htaccess</p>
<blockquote>
<p style="text-align:left;">RewriteRule news-(.+)\.html           /news.php?id=$1                     [L]</p>
</blockquote>
<p style="text-align:right;">لكن لو كانت هكذا :</p>
<blockquote>
<p style="text-align:left;">RewriteRule news-([0-9]+)\.html           /news.php?id=$1                     [L]</p>
</blockquote>
<p style="text-align:right;">فمستحيل تخطيها لأنه قام بفلترة فالمدخلات لن تكون إلا أعدادا</p>
<p style="text-align:right;">لكن لا مستحيل في عالم الهكر فلو أن المخترق عرف اسم الملف الحقيقي news.php و كان الملف مصاب فلا شيء يعيقه .</p>
<p style="text-align:right;">
<h2 style="text-align:right;">الخاتمة</h2>
<p style="text-align:right;">أولا ، اعذروني اخوتي على الاطالة لأن هذا موضوع مهم و لم أرى من قبل في أي منتدى عربي قد تطرق له !!!</p>
<p style="text-align:right;">و ما يجب تذكره هو ان ليس URL Rewriting هو نفسه المصاب بثغرة بل أنه يخفي وراؤه ثغرات في ملفات السكريبت .</p>
<p style="text-align:right;"><span style="color:#808080;"><br />
</span></p>
<p style="text-align:right;"><span style="color:#808080;">هذا و الله أعلم</span></p>
<p style="text-align:right;"><span style="color:#808080;">لا تنسوني من صالح دعائكم</span></p>
<p style="text-align:right;"><span style="color:#808080;">سلاآم</span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Apache redirect para dominios diferentes]]></title>
<link>http://salamand.wordpress.com/?p=74</link>
<pubDate>Tue, 26 Aug 2008 21:25:06 +0000</pubDate>
<dc:creator>rsasilva</dc:creator>
<guid>http://salamand.id.wordpress.com/2008/08/26/apache_redirect_para_dominios_diferentes/</guid>
<description><![CDATA[Problema:
 Você possui diversos domínios hospedados em um servidor Apache e deseja que todos eles ]]></description>
<content:encoded><![CDATA[<p><strong>Problema:</strong></p>
<p><strong> </strong>Você possui diversos domínios hospedados em um servidor Apache e deseja que todos eles sejam redirecionados para um outro domínio.</p>
<p><strong>Solução:</strong></p>
<p>Utilizar o mod_rewrite do apache com as seguintes condições e regra:</p>
<p><code>RewriteCond %{HTTP_HOST} ^dominio1.com(.*)      [OR]<br />
RewriteCond %{HTTP_HOST} ^www.dominio1.com(.*)  [OR]<br />
RewriteCond %{HTTP_HOST} ^outrodominio.com(.*)  [OR]<br />
RewriteCond %{HTTP_HOST} ^paraquetantodominio.com(.*)<br />
RewriteRule ^/(.*) http://www.dominioprincipal.com/$1   [L,R=301]</code></p>
<p><strong>Notas:</strong></p>
<ul>
<li> Os domínios <em>dominio1.com</em>, <em>www.dominio1.com</em>, <em>outrodominio.com</em> e <em>paraquetantodominio.com</em> devem estar configurados em ServerAlias</li>
<li>O (.*) é uma expressão regular (ER) que funciona como um coringa: deste ponto em diante a URL pode possuir qualquer seqüência de caracteres e ainda assim a condição será válida.</li>
<li>O $1 na linha RewriteRule diz ao Apache para completar o caminho do domínio.  Na verdade ele copia os caracteres que foram substituidos pela expressão regular  (.*) que está em ^/(.*) para frente do novo caminho.</li>
<li>O [L,R=301] significa:<br />
L : Não execute outra regra, esta é a última<br />
R=301 : Retorne ao usuário o código de status HTTP 301 (Moved Permanently).  Outros códigos HTTP e mais informações podem ser encontrados <a title="Status Code Definitions" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" target="_blank">aqui</a>. Se você utilizar apenas R o código que será enviado será o 302 (Moved Temporarily).</li>
<li>Recomendo a leitura da <a title="Apache Module mod_rewrite" href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html" target="_blank">página da Apache</a> sobre o mod_rewrite.</li>
</ul>
]]></content:encoded>
</item>
<item>
<title><![CDATA[SEO: Page title in your URL]]></title>
<link>http://vailo.wordpress.com/?p=166</link>
<pubDate>Wed, 13 Aug 2008 10:51:36 +0000</pubDate>
<dc:creator>vailo</dc:creator>
<guid>http://vailo.id.wordpress.com/2008/08/13/seo-page-title-in-your-url/</guid>
<description><![CDATA[We already covered the basic idea behind the friendly URL and how it can bring more visitors to your]]></description>
<content:encoded><![CDATA[<p>We already covered the basic idea behind the friendly URL and how it can bring more visitors to your web page. If you missed the post where we discussed this and implemented the mod_rewrite module in Apache, you can <a title="Friendly URLs" href="http://vailo.wordpress.com/2008/06/30/friendly-urls-with-wamp-apache/" target="_blank">read all about friendly URLs and our setup right here</a>. One growing, important, feature nowadays is the URL. People didn't come up with the idea of manipulating the URL people type in for no reason. It should be simple and easy to navigate through a website, right? Today we are going to make navigation via URL's even simpler, especially for dynamically build up websites. This is the idea:</p>
<p>Instead of using id's in the URL we are going to use the page title. We will not include the id of the object in the URL because if we had to do that, this wouldn't make it easier to navigate through since you have to know both the id and title of the object. In this post we will take a look at how we can use a game title instead a game id in our URL. The visitors of the site can easily guess the title of the game and just type it in!<br />
<!--more--><br />
Then end result will look something like this:</p>
<blockquote><p>http://www.dosspot.com/games/sam-and-max-hit-the-road/</p></blockquote>
<p>Looks nice? It looks a lot better than the current URL:</p>
<blockquote><p>http://www.dosspot.com/details.php?gameid=1</p></blockquote>
<p>So, here is what we need: A PHP function which takes a string and turn it into friendly chars we can use in our URL, a new column in our database table and finally some new lines in our .htaccess file.</p>
<p>OK, so what do we do with our PHP function? We keep it simple and effective. Anything not matching a char between a-z and A-Z or a number, 0-9, will be removed from the title. Every space we find we replace with a -.</p>
<blockquote><p>Example: Command and Conquer: Tiberan Dawn will do. This title would be suitable as a URL. We use our function and it will look like this: command-and-conquer-tiberan-dawn. Simple, nice and really cool!</p></blockquote>
<p>The implementation of this is not that hard. We extract and remove all bad chars in the title. It's very straightforward. Five lines of code:</p>
<blockquote><p><code>function createPermaLink($string)<br />
{<br />
$string = preg_replace("/(:&#124;;&#124;-&#124;\"&#124;\/&#124;\(&#124;\)&#124;\')/", "", strtolower($string));<br />
$string = preg_replace("/(\s)/", "-", strtolower($string));<br />
return $string;<br />
}</code></p></blockquote>
<p>We will use this function everytime we want to link to a game page. We will send the game title as the argument into the createPermaLink function and it will return a clean and URL friendly string back to us.</p>
<p>Next up we go to the MySQL database table we want to match our perma link with. We add a new coloumn named perma as a varchar length 100. We take the game title and use our newly created createPermaLink function and copy the text and paste it into the new database column. So, the database table might look like this:</p>
<blockquote><p><strong>ID</strong> <strong>Title                                                      Perma</strong><br />
1    Sam and Max Hit the Road             sam-and-max-hit-the-road</p></blockquote>
<p>Now we are able to do a SQL statement and try to select the row with a Perma value matching the incoming perma value from the URL. To be able to send a perma via the URL we need to add lines to our .htaccess file. Again, very easy:</p>
<blockquote><p><code>RewriteRule ^([a-z0-9\-]+)/$ /game.php?perma=$1 [L]</code></p></blockquote>
<p>Here I have a rule saying: Anything that matches a-z chars or 0-9 integers or a - is valid and it's redirected to my game.php page with a querystring attached named perma with a value. The value in our case will be the game title transformed by our createPermaLink function.</p>
<p>So in our game.php file we simple write a SQL statement to fetch the corrent row with our <a title="Database class" href="http://vailo.wordpress.com/2008/06/21/the-database-class/" target="_blank">Database class</a>:</p>
<blockquote><p><code>$perma = mysql_real_escape_string($_GET['perma']);<br />
$result = $db-&#62;fetchQuery("SELECT * FROM games WHERE perma = '$perma'");</code></p></blockquote>
<p>Pretty simple huh? The first line is just making sure that no hackers can break into our database and after that we use the $db object which is an instant of our Database class and we call our fetchQuery method to retrieve the row we want.</p>
<p>Three different areas we need to modify but only with very little code we are able to add the page title in the URL quite simple. The URL's is a lot nicer and SEO loves it!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Lean mean XML parsing machine]]></title>
<link>http://techprophet.wordpress.com/?p=44</link>
<pubDate>Sat, 09 Aug 2008 18:42:34 +0000</pubDate>
<dc:creator>techprophet</dc:creator>
<guid>http://techprophet.id.wordpress.com/2008/08/09/lean-mean-xml-parsing-machine/</guid>
<description><![CDATA[I just finished writing a new engine for my dad&#8217;s website! It parses XML files and places the ]]></description>
<content:encoded><![CDATA[<p>I just finished writing a new engine for my dad's website! It parses XML files and places the appropriate items in the title and body tags. I also have it so that it converts newlines to breaks using nl2br() (which is a godsend!). I'm getting ready to write him an editor for it so that he can't break the xml either (I have the pages disguised as .wood, his business is Woodsmith Creations, documents so that Windows won't pickup the extension and open it with the wrong program).</p>
<p>I also used a trick i found <a href="http://www.kpsforum.com/tutorials-stuff/467-php-alternative-mod_rewrite-se-friendly-urls.html">here</a> to do mod_rewrite-ish URLs without mod_rewrite! (AcceptPathInfo must be on in your httpd.conf though, so that PHP can access the $_SERVER['PATH_INFO'] variable)</p>
<p>Now I just need my partner to finish up CSS and Images and we will be ready to rock!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[The PHP Authorization Class]]></title>
<link>http://vailo.wordpress.com/?p=148</link>
<pubDate>Fri, 01 Aug 2008 07:05:58 +0000</pubDate>
<dc:creator>vailo</dc:creator>
<guid>http://vailo.id.wordpress.com/2008/08/01/the-php-authorization-class/</guid>
<description><![CDATA[When you decide to work with PHP and MySQL you probably end up creating some sort of user controlled]]></description>
<content:encoded><![CDATA[<p>When you decide to work with PHP and MySQL you probably end up creating some sort of user controlled application. It might not be your first application but rather soon you start working with forms and suddenly you have created a login form and want to validate the user on every single page to see if the user is allowed to view the page content. Today I will present my <strong>PHP Authorization Class</strong>.</p>
<p>The authorization class will not take care of a login script or anything validating a user trying to login on your application. If you need a <a title="SQL Login script" href="http://vailo.wordpress.com/2008/07/01/sql-login-function/" target="_blank">easy and fast login script you can read all about that</a> on my SQL Login post. This class will take care of the page validation you need to do to make sure the logged in user is valid. This is done by introducing three different types: roles, resources and actions.</p>
<p>A role represents a user group for example guest, member, staff or moderator. A resource is easily explained as an object such as news, articles, users or games. Lastly the action is something you want to do such as add, delete, edit, view or list. With these three types we are able to specify authorization rules for various roles.</p>
<p><!--more--></p>
<p>"Hum, I still don't get it!"</p>
<p>The PHP Authorization Class will help us define and set up rules for different roles. We can apply various action rules onto our resources which are, in the end, connected to our roles. We take a look at a example. Say we have three different roles defined for our application:</p>
<ul>
<li>guest - a visitor on the site which are not logged in.</li>
<li>member - a logged in visitor.</li>
<li>admin - the administrator</li>
</ul>
<p>To simplify our application we only have one resource on the site which is:</p>
<ul>
<li>news</li>
</ul>
<p>If we look at the overall actions we would like to do with this resource we might end up with something like this:</p>
<ul>
<li>view - look at a specific news item</li>
<li>list - look at all news items presented as a list</li>
<li>add - add news</li>
<li>edit - edit news</li>
<li>delete - delete news</li>
</ul>
<p>Going back to our roles, we don't want to let the guest role adding, editing nor deleting news. In this example we don't even let guests view a specific news. As for a member they should be able to view, list and add news. The administrator should be able to do everything. We can achieve this by writing something like this:</p>
<blockquote><p><code>$authorization = new Authorization();<br />
$guest = 'guest';<br />
$authorization-&#62;addRole($guest);<br />
$authorization-&#62;addAccess('news', $guest, 'list');</code></p>
<p><code>$member = 'member';<br />
$authorization-&#62;addRole($member, $guest);<br />
$authorization-&#62;addAccess('news', $member, array('view', 'add'));</code></p>
<p><code>$admin = 'admin';<br />
$authorization-&#62;addRole($admin, $member);<br />
$authorization-&#62;addAccess('news', $admin, array('edit', 'delete'));</code></p></blockquote>
<p>The above code implements the description of rules we stated a bit further up. We made a DSL to implement our authorization class if you will. Let's look at the code in more detail to see if we find anything interesting.</p>
<blockquote><p><code>$authorization = new Authorization();</code></p></blockquote>
<p>We create our PHP Authorization object and assign it to a variable named authorization.</p>
<blockquote><p><code>$guest = 'guest';<br />
$authorization-&#62;addRole($guest);<br />
$authorization-&#62;addAccess('news', $guest, 'list');</code></p></blockquote>
<p>We assign the variable guest the value of 'guest'. Then we add that variable to our list of roles our authorization class holds. The third line adds access rules. We start with providing the resource, the role and lastly the action. We could skip the first line and just add 'guest' instead of $guest. So, to make this very clear: These three lines of code gives the user group/role <em>guest</em> the ability to <em>list </em>all <em>news </em>on the site.</p>
<p>The next two sections are very similar to the first except for two things:</p>
<blockquote><p><code>$authorization-&#62;addRole($member, $guest);<br />
$authorization-&#62;addAccess('news', $member, array('view', 'add'));</code></p></blockquote>
<p>In the first section the addRole method only took one argument and here we have two. What does this mean? It means that the first argument will be extended with the second argument. In this case, member will be extended with guest. This is really useful if member should have the same access as guest plus a few more. We don't need to add the list action to member because guest already has it. Basically guest is the parent of member (which is acting like a child). Everything we add to guest is also added to member even if we decide to assign more rules to guest after we have defined and created the member role. Pretty sweet huh?</p>
<p>The other thing that differ is the number of actions you can provide to the addAccess method. You can add just one action as a normal string or provide an array of actions. Also very useful if a resource has a lot of different actions defined.</p>
<p>So, the code above created our three different roles and we applied different action access for each of the roles on our news resource. Now we are able to query our Authorization class to see if a specific role have access to a specific resource with a specific action. We do this by using the isAllowed method.</p>
<blockquote><p><code>echo $authorization-&#62;isAllowed($guest, 'news', 'list') ? 'allowed' : 'denied';</code></p></blockquote>
<p>What do you think? Is guest allowed to list the news? The answer is yes. Can answer these:</p>
<blockquote><p><code>echo $authorization-&#62;isAllowed($member, 'news', 'list') ? 'allowed' : 'denied';<br />
echo $authorization-&#62;isAllowed($member, 'news', 'add') ? 'allowed' : 'denied';<br />
echo $authorization-&#62;isAllowed($admin, 'news', 'add') ? 'allowed' : 'denied';<br />
echo $authorization-&#62;isAllowed($admin, 'news', 'list') ? 'allowed' : 'denied';<br />
echo $authorization-&#62;isAllowed($admin, 'news', 'comment') ? 'allowed' : 'denied';</code></p></blockquote>
<p>And the answers:</p>
<blockquote><p>Yes, member is extended with guest and guest is allowed to list news.<br />
Yes, member is allowed to add news.<br />
Yes, admin is extended by member and member is allowed to add news.<br />
Yes, admin is extended by member and member is extended by guest and guest is allowed to list news.<br />
No, admin is denied to comment on news.</p></blockquote>
<p>Pretty cool! This can be used in your PHP pages where you need to check if the user is valid. For example in your header file to make sure unauthorized users don't get access to your pages and files. To know if you should add a comment form or not you simple check if the role in question have the access to comment. You are able to be very specific and you can show different parts of the page depending on the role type.</p>
<p>Since the class doesn't require a database it's 100% customizable. You can add your very own roles, resources and actions. All of this sounds pretty nice but how would it work in real action? I will give you a sweet example.</p>
<p>To be able to check if the role has access to the resource with a specific action we need to know the role, the resource and of course the action. It might sound like a huge amount of effort to get this to work, but it isn't! The specific role needs to be fetch from the user in question. Let's say we have a database with users and each user has a access type, say A-C. Either you can use these values straight of as your roles or we can translate them to understandable roles: A = guest, B = member and C = admin. This can then be saved in a session or in anyway you know as long as you are able to access it often and fast. The get our hands on the resource and action we can use the splendid mod_rewrite found in the Apache server software. If you don't know what this module does, I suggest you <a title="Friendly URL's" href="http://vailo.wordpress.com/2008/06/30/friendly-urls-with-wamp-apache/" target="_blank">take a peak at my other post about friendly URL's</a>. If we use the .htaccess wisely we will be able to fetch the resource and action from our URL.</p>
<p>.htaccess example:</p>
<blockquote><p><code>RewriteEngine on<br />
RewriteRule ^([a-z_]+)$ /authorization/$1/ [R]<br />
RewriteRule ^([a-z_]+)/$ /authorization/index.php?resource=$1&#38;action=list<br />
RewriteRule ^([a-z_]+)/([a-z_]+)$ /authorization/$1/$2/ [R]<br />
RewriteRule ^([a-z_]+)/([a-z_]+)/$ /authorization/index.php?resource=$1&#38;action=$2</code></p></blockquote>
<p>In this example my root is /authorization. The first two rewrites takes care of an example looking like this:</p>
<blockquote><p>http://www.dosspot.com/games</p></blockquote>
<p>It will first add a / to the end and reload and send the user to my index page with two get variables resource and action. We we haven't added an action the default action is list. The other two rules are activated if we have applied an action to.</p>
<blockquote><p>http://www.dosspot.com/games/view/</p></blockquote>
<p>Now we are able to fetch the resource and action out from our GET array and see if the role is valid for this page. If not we send him/her of to another page. So now we have two examples where we use the Authorization class inside a page using the isAllowed method to see if the user in question should be able to do various actions. Or we can use the URL to fetch the resource and action in question and validate. In our index.php page it might look something like this:</p>
<blockquote><p><code>if(isset($_GET['resource']) &#38;&#38; isset($_GET['action'])) {<br />
$resource = mysql_real_escape_string($_GET['resource']);<br />
$action = mysql_real_escape_string($_GET['action']);<br />
$role = $_SESSION['role'];<br />
}</code></p>
<p><code>if($authorization-&#62;isAllowed($role, $resource, $action)) {<br />
echo 'You are allowed';<br />
} else {<br />
echo 'You are not allowed in here!';<br />
}</code></p></blockquote>
<p>Pretty simple put yet effective. But! There is more to it! Now we have a set of methods we can use to grant access to resources with different actions. If a user doesn't have the access s/he is thrown out from that page. We might want to apply a few of these access rules to every role avaible and we don't want to use extend, because there might just be one access we want to share, and we don't want to write it twice. How can we do this? Simple, we add null instead of a role in the addAccess method. By supplying null as the role the access rule will be applied to all roles, including roles added after the null access.</p>
<p>So let's say we want our guest to be able to access both the list and add news. The member role should just be able to list, not add. In this case we cannot extend the member role with the guest role since then the member role would be able to add news. Here is some code:</p>
<blockquote><p><code>$authorization = new Authorization();<br />
$authorization-&#62;addAccess('news, null, 'list);</code></p>
<p><code>$guest = 'guest';<br />
$authorization-&#62;addRole($guest);<br />
$authorization-&#62;addAccess('news', $guest, 'add');</code></p>
<p><code>$member = 'member';<br />
$authorization-&#62;addRole($member);<br />
$authorization-&#62;addAccess('news', $member, 'view');</code></p></blockquote>
<p>With this slightly different code everyone will be able to list the news but the guest will be the only one able to add news and member the only one able to view a news. If this would be a real case it would be very bad, in this example though it shows the example pretty well. Notice that member isn't extended by the guest role.</p>
<p>The next thing we might be interested in is how we save the authorization object. We can do this with a simple session or we can store it using the serialize method in PHP. Since we have been working with session before we are going to use the serialize technique. Basically we are able to serialize an object meaning that we are able to save it on a file. We can then just unserialize the file and get our object back. By doing this we can write our authorization code in one file, serialize it and remove that code. Since the object is stored in a file we don't need to create our object everytime we want to access it, we just unserialize the file and the object with it's current state it presented to us. Sadly I'm a newbie working with the serialize method so if you know any problems or errors working with it, please let me know.</p>
<p>We simply use the save() method in the Authorization class to serialize our authorization object. We are able to provide a filename, by default it's saved as authorization. With our .htaccess file we are able to block everyone out from this file and deny everyone trying to access it. In every page we want to validate the user we simple do this:</p>
<blockquote><p><code>include('Authorization.php');<br />
$object = implode("", @file("authorization"));<br />
$authorization = unserialize($object );</code></p></blockquote>
<p>We have to include the class file and then we read the file and finally use the unserialize method to unserialze the object and we assign it again to our authorization variable. Now we are able to use the object exactly the same as we did in the examples above. Combine this with the .htaccess rewrite options you will find it rather easy to control the visitors using your system. It's easy, straight forward and pretty cool!</p>
<p>The download below provides everything you will need to run the authorization class, including unit tests!</p>
<ul>
<li><a title="Authorization Class" href="http://www.dosspot.com/authorization.zip" target="_blank">Download the PHP Authorization Class</a></li>
</ul>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Eerste hulp bij mod_rewrite]]></title>
<link>http://aiids.wordpress.com/?p=38</link>
<pubDate>Wed, 30 Jul 2008 02:14:23 +0000</pubDate>
<dc:creator>stijn1989</dc:creator>
<guid>http://aiids.id.wordpress.com/2008/07/30/eerste-hulp-bij-mod_rewrite/</guid>
<description><![CDATA[Deze post zal niet zo nuttig zijn voor ervaren webontwikkelaars maar vind het toch nog de moeite om ]]></description>
<content:encoded><![CDATA[<p>Deze post zal niet zo nuttig zijn voor ervaren webontwikkelaars maar vind het toch nog de moeite om eens te posten voor nieuwelingen. Als je de module Rewrite hebt geactiveerd en je .htaccess ziet er als volgt uit.</p>
<blockquote><p>RewriteEngine on</p>
<p>RewriteRule ^expressie$ link [L]</p></blockquote>
<p>Maar je krijgt een HTTP/404 of een HTTP/500 dan moet je in de <strong>httpd.conf</strong> (staat in je apache configuratiemap) kijken naar &#60;directory /path/to/www&#62; naar <strong>AllowOverride</strong>. Als die op None of er staat een hele lijst achter, vervang die regel dan door.</p>
<blockquote><p>AllowOverride All</p></blockquote>
<p>Herstart Apache en het is gefixed! Nog problemen? Kijk eens in je error.log van apache. Kom je er nog niet aan uit? Zet dan de module Spelling uit en als het nog niet gefixed is, vraag het in #apache op irc.freenode.org.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[URLs]]></title>
<link>http://orqi.wordpress.com/?p=36</link>
<pubDate>Thu, 24 Jul 2008 09:20:25 +0000</pubDate>
<dc:creator>orqi</dc:creator>
<guid>http://orqi.id.wordpress.com/2008/07/24/urls/</guid>
<description><![CDATA[A typical Orqi url will look something like this with mod_rewrite enabled ..
http://telephotos.co.uk]]></description>
<content:encoded><![CDATA[<p><!--more-->A typical Orqi url will look something like this with mod_rewrite enabled ..<br />
<a href="http://telephotos.co.uk/photo/latest.html" target="_blank_">http://telephotos.co.uk/photo/latest.html</a></p>
<p>... or like this with mod_rewrite disabled<br />
<a href="http://telephotos.co.uk/index.php?object=photo&#38;action=latest" target="_blank_">http://telephotos.co.uk/index.php?object=photo&#38;action=latest</a></p>
<p>Note that they both go to the same page. What is happening is the Orqi Loader is receiving the object and action parameters and then using them to look for a controller. First it will look in your nominated "_classes/_app" folder, then it will look in your nominated "_orqi/_app" folder for a default controller. If it can't find one then an error is returned to the screen of the ilk "Error: Class PhotoController not found."</p>
<p>The object parameter is the name of the controller and action is the name of the function in the controller. In the example above, this means Orqi will be looking to execute a function called "Latest" in a class called "PhotoController" which is in a file called "PhotoController.php".</p>
<h3>Enable mod_rewrite</h3>
<p>If you look in the config.php file you will notice a line like this ...</p>
<p>[sourcecode language='php']$this->app['mod_rewrite'] = true;[/sourcecode]</p>
<p>Set it to true to enable the nicer URL writing. Orqi will also produce nice URLs in functions like Controller::MakeLink()</p>
<p><em>NB:</em> You MUST have the mod_rewrite module loaded on your webserver</p>
<h3>.htaccess</h3>
<p>Here is like the most basic .htaccess file you can get away with. It's here where the urls are redirected from "/niceurl/mycommand.html" to "/index.php?object=aargh&#38;action=horridurl".</p>
<p>[sourcecode language='cpp']<br />
RewriteEngine on<br />
RewriteRule ^pages/(.*).html$ index.php?object=page&action=view&id=$1&%{QUERY_STRING} [L]<br />
RewriteRule ^(.*)/(.*).html$ index.php?object=$1&action=$2&%{QUERY_STRING} [L]<br />
[/sourcecode]</p>
<h3>The File Extensions</h3>
<p>If you want to change the url extensions in your urls just look for the following line in your config.php.  The file extension in your config file must agree with the file extensions in your .htaccess file.</p>
<p><em>(My advice is leave it as html. I was using .orqi for a while before I realised it was an SEO suicide move)</em></p>
<p>[sourcecode language='php']$this->app['extension'] = 'html';[/sourcecode]</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Habilitando o redirect de http para https no Apache2 ( Updated )]]></title>
<link>http://penguim.wordpress.com/?p=377</link>
<pubDate>Thu, 17 Jul 2008 02:10:50 +0000</pubDate>
<dc:creator>penguim</dc:creator>
<guid>http://penguim.id.wordpress.com/2008/07/16/habilitando-o-redirect-de-http-para-https-no-apache2/</guid>
<description><![CDATA[Complementando o artigo anterior que descrevia como habilitar o SSL no Apache 2, agora apresento com]]></description>
<content:encoded><![CDATA[<p>Complementando o <a href="http://penguim.wordpress.com/2008/07/14/habilitando-ssl-no-apache2/">artigo</a> anterior que descrevia como <a href="http://penguim.wordpress.com/2008/07/14/habilitando-ssl-no-apache2/">habilitar o SSL no Apache 2</a>, agora apresento como habilitar o redirect de http para https no Apache 2, fazendo com que seu site funcione por padrão em modo seguro.</p>
<p>Habilite o mod_rewrite </p>
<blockquote><p>
a2enmod rewrite
</p></blockquote>
<p>OBS: Valeu <a href="http://rbelem.eti.br/">Rodrigo</a>!!!</p>
<p>Adicione as seguintes linhas no arquivo /etc/apache2/sites-available/default</p>
<blockquote><p>
        ...<br />
        CustomLog /var/log/apache2/access.log combined<br />
        ServerSignature On<br />
        RewriteEngine   on<br />
        RewriteCond     %{SERVER_PORT} ^80$<br />
        RewriteRule     ^(.*)$ https://%{SERVER_NAME}$1 [L,R]<br />
        RewriteLog      "/var/log/apache2/rewrite.log"<br />
        RewriteLogLevel 2<br />
        ...
</p></blockquote>
<p><a href="http://edin.no-ip.com/content/apache-https-redirect-debian-mini-howto">Fonte</a></p>
<p><a href="http://penguim.wordpress.com/files/2007/03/creysson.jpg"><img src="http://penguim.wordpress.com/files/2007/03/creysson.jpg?w=101" alt="" width="101" height="102" class="alignnone size-medium wp-image-171" /></a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Apache 2.2 and mod_rewrite]]></title>
<link>http://dayg.wordpress.com/?p=123</link>
<pubDate>Thu, 10 Jul 2008 09:17:35 +0000</pubDate>
<dc:creator>dayg</dc:creator>
<guid>http://dayg.id.wordpress.com/2008/07/10/apache-22-and-mod_rewrite/</guid>
<description><![CDATA[This is a super short (and very rough) post on how to enable mod_rewrite in Apache 2.2.
I have seen ]]></description>
<content:encoded><![CDATA[<p>This is a super short (and very rough) post on how to enable mod_rewrite in Apache 2.2.</p>
<p>I have seen numerous posts on how to create "rewrite" scripts but found very little information on how to enable this feature in Apache 2.2.</p>
<p>Step 1: Uncomment the line with "mod_rewrite.so" from httpd.conf</p>
<blockquote><p>LoadModule rewrite_module modules/mod_rewrite.so</p></blockquote>
<p>Step 2: Search for the keyword ".htaccess" and change the AllowOverride value</p>
<blockquote><p>AllowOverride All</p></blockquote>
<p>Step 3: Restart Apache and check if module has been loaded (LoadedModule section in phpinfo())</p>
<p>Step 4: Create a test .htaccess in your root directory</p>
<blockquote><p>Options +Indexes<br />
Options +FollowSymlinks<br />
RewriteEngine on<br />
RewriteBase /<br />
RewriteRule ^success\.html$ index.php [L]</p></blockquote>
<p>Step 5: Type http://localhost/success.html in your browser (change port info based on your setup)</p>
<p>You should be able to see your index.php load up.</p>
<p>Recommended book:</p>
<p><a href="http://www.amazon.com/gp/product/1590595610/104-2616196-5897505?ie=UTF8&#38;tag=doasyogo-20&#38;linkCode=xm2&#38;camp=1789&#38;creativeASIN=1590595610"><img src="http://rcm-images.amazon.com/images/I/51oEkibQT2L._SL75_.jpg" border="0" alt="1590595610" /></a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[перфектният .htaccess / mod_rewrite защита]]></title>
<link>http://nigon.wordpress.com/?p=21</link>
<pubDate>Wed, 09 Jul 2008 15:19:11 +0000</pubDate>
<dc:creator>nigon</dc:creator>
<guid>http://nigon.id.wordpress.com/2008/07/09/perfect-htaccess/</guid>
<description><![CDATA[
Pastebin: .htaccess
Източник: rvdh
]]></description>
<content:encoded><![CDATA[<p><img class="alignleft" src="http://img89.imageshack.us/img89/4374/shieldsc9.png" alt="security" /></p>
<hr />Pastebin: <a href="http://pastebin.com/f76042868">.htaccess</a><br />
Източник: <a href="http://0x000000.com">rvdh</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Ubuntu - Enable mod_rewrite in Apache server]]></title>
<link>http://mahmudahsan.wordpress.com/?p=105</link>
<pubDate>Sun, 06 Jul 2008 07:01:22 +0000</pubDate>
<dc:creator>mahmudahsan</dc:creator>
<guid>http://mahmudahsan.id.wordpress.com/2008/07/06/ubuntu-enable-mod_rewrite-in-apache-server/</guid>
<description><![CDATA[At first I should define, what is mod_rewrite?
mod_rewrite is a part of Apache server that can rewri]]></description>
<content:encoded><![CDATA[<p>At first I should define, what is mod_rewrite?<br />
<strong>mod_rewrite is a part of Apache server that can rewrite requested urls on the fly.</strong></p>
<p>To enable mod_rewrite in Ubuntu, you just need to write this command in terminal<br />
<code><br />
<strong>sudo a2enmod rewrite</strong></code></p>
<p>After enabling mod_rewrite you can write .htaccess file for your web application.</p>
<p>So what is .htaccess?<br />
<strong>.htaccess file provides a way to make configuration changes on a per directory basis.</strong> It is a file contains configuration directives is placed in a particular document directory and the directives apply to that directory and all subdirectories thereof.</p>
<p>Some example:</p>
<p>Nice looking URLs (no querying) with pagination:<br />
Suppose your url is: <em>domain.com/article.php?name=title&#38;page=5<br />
</em>You want to change: <em>domain.com/articles/title/5/</em><br />
Then write in .htaccess file:<br />
<strong>RewriteRule ^articles/(A-Za-z0-9-]+)/([0-9]+)/?$ article.php?name=$1&#38;page=$2 [L]</strong></p>
<p>The rule is defined in regular expression. Here <strong>[L]</strong> means Last Rule. It's called RewriteRule Flags.</p>
<p>Another example:<br />
Suppose your site has permanently moved to a new domain.<br />
<strong> RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]<br />
RewriteRule  ^(.*)$ http://www.domain2.com/$1  [R=301, L]</strong></p>
<p>Here [NC] means case insensitive and its called RewriteCond Flags. [R=301] means moved permanently. Its called redirection header code.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Friendly URLs with WAMP &amp; Apache]]></title>
<link>http://vailo.wordpress.com/?p=53</link>
<pubDate>Mon, 30 Jun 2008 06:03:39 +0000</pubDate>
<dc:creator>vailo</dc:creator>
<guid>http://vailo.id.wordpress.com/2008/06/30/friendly-urls-with-wamp-apache/</guid>
<description><![CDATA[It has been a very hot topic for a long time. The Friendly URLs have taken the Internet by storm, mo]]></description>
<content:encoded><![CDATA[<p>It has been a very hot topic for a long time. The <strong>Friendly URLs</strong> have taken the Internet by storm, mostly because the expanding use of Ruby on Fai..Rails. :) Today we are going to look at how we can create friendly URLs using the Apache HTTP server found in the WAMP software installation. It will actually be very simple! Depending on your environment and knowledge we are first looking at how we can add the support to use friendly URLs in WAMP and a quick look on how we can do it without the WAMP software. If you want to use the WAMP software you can download it below:</p>
<ul>
<li><a title="WAMP Software" href="http://vailo.wordpress.com/2008/06/20/getting-started-wamplamp/" target="_self">Download the WAMP software</a></li>
</ul>
<p><!--more--></p>
<p>We are going to start looking at the WAMP software first. After you have downloaded and installed the WAMP software you should find a short cut item on your Desktop. Click on that, in the right corner of your screen you should see some sort speed limit panel turning red, yellow and lastly white. If it doesn't turn white something is wrong with the setup. If you haven't changed anything from the default settings when installing the WAMP software. The activate the module making it possible to create friendly URLs we simple do this:</p>
<ol>
<li>Left click on the WAMP icon in the right corner of the screen.</li>
<li>Move you mouse over the 'Apache' link.</li>
<li>In the popup menu, move your mouse over the 'Apache Modules' link.</li>
<li>Move down in the list by pressing the down arrow image until you find <em>rewrite_module</em>.</li>
<li>Click on the rewrite_module.</li>
<li>The WAMP software should restart, if it isn't do it your self be left clicking on the icon again and choose 'Restart All Services'.</li>
</ol>
<p>So now we have the rewrite_module activated in WAMP. To active the rewrite_module without WAMP you need to go to your Apache directory, or make a search with the keyword httpd.conf. That file contains a lot of config options for your Apache HTTP server. Inside that file, search for:</p>
<blockquote><p>LoadModule rewrite_module modules/mod_rewrite.so</p></blockquote>
<p>That module will have a # in front of it, remove that and save the httpd.conf file and restart your Apache server. This is how you activate the rewrite_module in Apache and not via the WAMP software. Seems rather easy, right?</p>
<p>Okay, so what we have done so far is to activate a module we are going to use when we want to write friendly URLs. Friendly URLs you say? What is that? In my <a title="12 SEO Tips" href="http://vailo.wordpress.com/2008/06/29/12-seo-tips/" target="_self">12 SEO Tips</a> post I talked about friendly URLs and how they are much better for web spiders, visitors and for yourself. The result after turning your unfriendly URLs into friendly once are this:</p>
<blockquote><p>We turn this dynamically created, unfriendly URLs:<br />
http://www.yourdomain.com/users.php?id=12</p>
<p>Into this friendly URL:<br />
http://www.yourdomain.com/users/12/</p></blockquote>
<p>Does that look a lot better than the first one? Especially if your website is targeting people with a lack of Internet experience. The simpler and cleaner your URL look like, the better. We will even have the chance of enter a name.html and turn it into name.php without the visitor knowing anything about it. Why should we like to  do that? Once again, it's better for the web spider and in the end your chance of being found in a search will expand.</p>
<p>So, the rewrite module activated and running, what do to next? We are going to create a file with the name <em>.htaccess.</em> This file is a configuration file working tightly with the Apache HTTP server.  This is how the Apache team describes it:</p>
<blockquote><p>"<code>.htaccess</code> files (or "distributed configuration files")     provide a way to make configuration changes on a per-directory basis. A     file, containing one or more configuration directives, is placed in a     particular document directory, and the directives apply to that     directory, and all subdirectories thereof. <a title="Apache htaccess files" href="http://httpd.apache.org/docs/1.3/howto/htaccess.html" target="_blank">Read more about the .htaccess files</a>"</p></blockquote>
<p>Inside this file we are able to create patterns which will match the incoming URL. If the URL match any of our patterns we are able to transform the incoming URL into something else. What does this mean? It means that you don't have to change any PHP query strings code to transform your URLs. With the .htaccess file you are able to redirect your visitors to the correct page you want them to look at, but the address looks the same to them. Here is an example:</p>
<blockquote><p>Your visitor writes:<br />
http://www.yourdomain.com/users/12/</p>
<p>In your .htaccess file you do this with the incoming URL:<br />
http://www.yourdomain.com/users.php?id=12</p></blockquote>
<p>Looks like magic? It is! :) Naa, not really but it looks a lot nicer and, as I have told you several times now, it helps your search rankings.</p>
<p>The following will be an example of a .htaccess file. We will go through it line by line and see what it does.</p>
<blockquote><p>1. RewriteEngine on<br />
2. RewriteRule ^(/)?$ /index.php [L]<br />
3. RewriteRule ^([^\/\.]+)\.html$ $1.php [L]<br />
4. RewriteRule ^([a-z]+)/([0-9]+)$ /$1/$2/ [R]<br />
5. RewriteRule ^([a-z]+)/([0-9]+)/$ /$1.php?id=$2</p></blockquote>
<p>Line 1: Activates the rewrite module for this particular folder. This line is required for ALL .htaccess files.</p>
<p>Line 2: We rewrite http://www.yourdomain.com/ to http://www.yourdomain.com/index.php. The [L] at the end is telling the .htaccess file to stop rewriting if this pattern has been match.</p>
<p>Line 3: We rewrite all incoming .html files into .php. We do this because it's easier for visitors to enter .html instead of .php.</p>
<p>Line 4. We rewrite http://www.yourdomain.com/users into http://www.yourdomain.com/users/. We just add the extra / at the end to say: "Hey, this is how we like it". The [R] at the end is telling the .htaccess to continue the rewrite regardless if the pattern matched or not.</p>
<p>Line 5. Is rewriting http://www.yourdomain.com/users/12 into http://www.yourdomain.com/users.php?id=12.</p>
<p>Very simple. The pattern is using the cross-language script regexp, or regular expressions.  A good place to start looking at regexp if you haven't heard about it before is the link below:</p>
<ul>
<li><a title="Regual expressions" href="http://www.regular-expressions.info/" target="_blank">Read more about Regual Expressions</a></li>
</ul>
<p>So by using the rewrite module found in the Apache HTTP server and creating a .htaccess file inside our main directory we can accomplish the friendly URLs task. Excited? I know I was the first time. Start right away!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Url Rewriting using php, smarty and mod_rewrite]]></title>
<link>http://amitgharat.wordpress.com/?p=3</link>
<pubDate>Wed, 18 Jun 2008 18:45:39 +0000</pubDate>
<dc:creator>amitgharat</dc:creator>
<guid>http://amitgharat.id.wordpress.com/2008/06/18/url-rewriting-using-php-smarty-and-mod_rewrite/</guid>
<description><![CDATA[Let&#8217;s learn to rewrite the website url today.
According to me, before learning something new, ]]></description>
<content:encoded><![CDATA[<p>Let's learn to rewrite the website url today.</p>
<p>According to me, before learning something new, we should take a look at why we need to do it and what's the use of it.</p>
<p><span style="font-weight:bold;">Use of URL rewriting:</span><br />
1. Making website URLs more user and search engine friendly.<br />
2. Preventing undesired "inline linking".<br />
3. Not exposing the inner workings of a web site's address to visitors</p>
<p><span style="font-style:italic;">So let's begin...</span></p>
<p><span style="font-weight:bold;">Project Name: </span>url_rewriting<br />
<span style="font-weight:bold;">Dir. Structure: </span>url_rewriting<br />
- cache<br />
- configs<br />
- libs<br />
- templates<br />
- templates_c<br />
- .htaccess<br />
- other php files</p>
<p><span style="font-weight:bold;">What we want to achieve:</span><br />
here we want to convert the following url<br />
from,<br />
http://www.orkut.com/UniversalSearch.php?origin=box&#38;exp=1&#38;q=php<br />
to<br />
http://www.orkut.com/box/1/php/UniversalSearch.html</p>
<p><span style="font-weight:bold;">How we can achieve:</span><br />
we need to first create a file "function.seo_optimise.php" in "smarty/lib/plugins/", so that smarty will treat it as its own function without any hassal.</p>
<p><span><br />
<span>function smarty_function_seo_optimise($params, &#38;$smarty)</span><br />
<span>{</span><br />
<span> // we will add code here later...</span><br />
<span>}</span><br />
<span>?&#62;</span></span></p>
<p><span style="font-weight:bold;">Done... 50%</span></p>
<p><span>Now secondly, we have to create a .htaccess file in the directory structure as shown above. And add following...</span></p>
<p><span>php_value error_reporting 7</span><br />
<span>Options +FollowSymLinks</span><br />
<span>RewriteEngine on</span><br />
<span>RewriteRule ^(.*)/([0-9]+)/(.*)/UniversalSearch.html$ UniversalSearch.php?origin=$1&#38;exp=$2&#38;q=$3</span></p>
<p><span>Please note that, (.*) suggest the type of text we are sending to perticular querystring. Like for origin querystring, we are going to send anything including characters &#38; numbers, or in case of exp querystring, we are going to send only numbers thats why we have used ([0-9]+) in order to restrict the querystring value to the numbers only.</span></p>
<p><span style="font-weight:bold;">Done... 70%</span></p>
<p><span>I know, you are confused now, because you are thinking that how smarty will know, (.*) for origin, ([0-9]+) for exp and (.*) for q.</span> <span>Do not worry, thats we have created "function.seo_optimise.php" file above.</span> <span>Now, open this file, and write the following code...</span> <span>please note that here we are going to send three querystrings to the page thats why we have to pass three parameters to the function also.</span> <span>These are the three parameters..</span><br />
<span>function smarty_function_seo_optimise($params, &#38;$smarty)</span><br />
<span>{</span><br />
<span> /* This is for three querystrings */</span><br />
<span> $origin =  $params[origin];</span><br />
<span> $exp     =  $params[exp];</span><br />
<span> $q         =  $params[q];</span><br />
<span> /* This is to recognise the page to which we are going to rewrite */</span><br />
<span> if($params[type] == 'universal_page')</span><br />
<span> {</span><br />
<span> if($params[urls] == 'Enable')</span><br />
<span> return $origin.$exp.$q."/UniversalSearch.html";</span><br />
<span> else </span><br />
<span> return "UniversalSearch.php?origin=".$origin."&#38;exp=".$exp."&#38;q=".$q</span><br />
<span> }</span></p>
<p><span>}</span></p>
<p><span style="font-weight:bold;">Done... 80%</span></p>
<p><span>Now let me explain you, this smarty function will transform our old url to new like this...</span> <span>http://www.orkut.com/box/1/php/UniversalSearch.html</span> <span>Ok then, time to spell the beans...</span> <span>to convert that url we have to write following in .tpl file.</span></p>
<p><span>{seo_optimise urls=$seo_urls origin=box exp=1 q=php type=universal_page}</span></p>
<p><span>&#60;a href="http://www.blogger.com/%7Bseo_optimise%20urls=$seo_urls%20origin=box%20exp=1%20q=php%20type=universal_page%7D"&#62;<br />
Click me<br />
&#60;/a&#62;</span></p>
<p><span>here is a explaination...<br />
</span> <span><br />
$seo_urls =&#62; Enable/Disable</span></p>
<p><span>when the page get loaded, that seo_optimise will pass the supplied parameters to the function of a same name created in smarty/lib/plugins/function.seo_optimise.php.</span></p>
<p>1. First, it will add the passed value to appropriete variables as mentioned above in this php file.<br />
<span>2. secondly, it will check which page you want to rewrite using "type" variable.<br />
</span><span>3. If it is "universal_page" and $seo_urls is "Enable" then it will return the url like</span> <span>http://www.orkut.com/box/1/php/UniversalSearch.html</span> <span>or</span> <span>if $seo_urls is "Disable" then it will return the url like</span> <span>http://www.orkut.com/UniversalSearch.php?origin=box&#38;exp=1&#38;q=php</span><br />
<span style="font-weight:bold;">Done... 100%</span></p>
<p><span>Using this way we can rewrite any url in any ways you want, just do not forget to enter the old url &#38; new url in .htaccess file.</span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Interesting Information Security Bits for June 17th]]></title>
<link>http://infosecramblings.wordpress.com/?p=63</link>
<pubDate>Tue, 17 Jun 2008 15:28:16 +0000</pubDate>
<dc:creator>Kevin Riggins</dc:creator>
<guid>http://infosecramblings.id.wordpress.com/2008/06/17/interesting-information-security-bits-for-june-17th/</guid>
<description><![CDATA[Hello all.  Sorry I didn&#8217;t get yesterday&#8217;s post out.  Today&#8217;s includes yesterday]]></description>
<content:encoded><![CDATA[<p>Hello all.  Sorry I didn't get yesterday's post out.  Today's includes yesterday's stuff and today's so it is a bit long.</p>
<p><strong>From the Blogosphere.<br />
</strong><br />
DVLabs put a post up yesterday that is the first in a weekly feature that Cody is starting regarding reverse engineering tips and tricks.  The <a href="http://dvlabs.tippingpoint.com/blog/2008/06/05/mindshare-public-toolkits" target="_blank">first post</a> takes a look at the <a href="http://www.rhapsody.com/-software?pageid=unagi.11894418.wrapper&#38;pageregion=div_02&#38;pcode=rn&#38;opage=learn_rhap_whatis" target="_blank">Rhapsody Media Player</a>.  Interesting stuff.</p>
<p>Rafal gives us a <a href="http://preachsecurity.blogspot.com/2008/06/cross-site-scirpting-xss-real-world.html" target="_blank">real-world example of XSS</a>.  Worth a look.</p>
<p>Frank Cassano has part 2 of his <a href="http://www.bloginfosec.com/2008/06/16/assessing-your-organizations-network-perimeter-pt-2/" target="_blank">Assessing your Organization's Network Perimiter</a> available.  Part 1 is <a href="http://www.bloginfosec.com/2008/06/02/assessing-your-perimeter-part-i/" target="_blank">here</a>. Good stuff.</p>
<p>Rich points out that it in the world of SQL injection, it is <a href="http://securosis.com/2008/06/13/separation-of-dutiesfunctions-sql-injection/" target="_blank">very important that collaboration occur with our database admins and architects</a> to ensure we are restricting rights appropriately.</p>
<p>Lori points out that <a href="http://devcentral.f5.com/weblogs/macvittie/archive/2008/06/16/3361.aspx" target="_blank">dynamic resource obfuscation</a> can help us make the target much harder to find, let alone hit for the evil haxors out there. She is not promoting security through obscurity, but suggesting that we can actively make it very difficult for an attacker to figure out what to attack.</p>
<p>Donald Donzal, the editor in chief at the Ethical Hacker Network has posted a recording and slides of the presentation he gave at the Sans What Works in Pen Testing Summit titled "<a href="http://www.ethicalhacker.net/content/view/201/24/" target="_blank">Remodeling your career for little to no money down</a>".  I've got my copies downloaded and will be listening soon.</p>
<p>Via Xavier are <a href="http://blog.rootshell.be/2008/06/16/lynis-security-and-system-auditing-tool/" target="_blank">/dev/random</a>, <a href="http://www.rootkit.nl/about/" target="_blank">Michael Boelen</a>, the creator <a href="http://blog.rootshell.be/2008/06/16/lynis-security-and-system-auditing-tool/" target="_blank">RootKit Hunter</a>, has released a new tool that should be welcomed by all UNIX folks, <a href="http://www.rootkit.nl/projects/lynis.html" target="_blank">Lynis: Security and System Auditing Tool</a>.  Go take a look.</p>
<p>Adam Dodge has a post up over at Security Catalyst that reminds us to <a href="http://www.securitycatalyst.com/blog/2008/06/16/on-reports-a-perspective/" target="_blank">keep in mind the samples used when reading a report</a>.  This applies to every report you might read that has statistical data in it, but he is specifically talking about the number of reports that have come out recently regarding breach statistics.</p>
<p>0x000000 has updated the <a href="http://www.0x000000.com/?i=596" target="_blank">mod_rewrite signatures</a> used as a poor man's web application firewall to add some banner obsfucation stuff.  If you haven't seen the full set, poke around on the site.  It is good stuff.</p>
<p>Finally, the folks at wartchfire have an article up talking about <a href="http://blog.watchfire.com/wfblog/2008/06/cross-environme.html" target="_blank">cross environment hopping</a>.  This is where an XSS vulnerability is exploited to hop to another service hosted on the target client machine.  Not cool.  Go read it...twice :)</p>
<p>I will be posting the interesting bits from news sources a little later today.</p>
<p>Kevin</p>
<p>Technorati Tags: <a class="performancingtags" rel="tag" href="http://technorati.com/tag/reverse%20engineering">reverse engineering</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/xss">xss</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/perimiter">perimiter</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/sql%20injection">sql injection</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/resource%20obfuscation">resource obfuscation</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/career">career</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/lynis">lynis</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/breach%20reports">breach reports</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/mod_rewrite">mod_rewrite</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/cross%20environment%20hopping">cross environment hopping</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[htaccess rewrite code explanation]]></title>
<link>http://htaccessrewrite.wordpress.com/?p=7</link>
<pubDate>Mon, 02 Jun 2008 04:45:53 +0000</pubDate>
<dc:creator>wordpress htaccess</dc:creator>
<guid>http://htaccessrewrite.id.wordpress.com/2008/06/02/htaccess-rewrite-code-explanation/</guid>
<description><![CDATA[

I have a wordpress blog installed in root (htdocs). Wp has kindly modified the .htaccess file to i]]></description>
<content:encoded><![CDATA[<div id="post_message_455766">
<div style="margin:5px 20px 20px;">
<div class="smallfont" style="margin-bottom:2px;">I have a wordpress blog installed in root (htdocs). Wp has kindly modified the .htaccess file to include<br />
# BEGIN WordPress<br />
&#60;IfModule mod_rewrite.c&#62;<br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]<br />
&#60;/IfModule&#62;</p>
<p># END WordPress</p>
<p>ErrorDocument 404 /index.php?error=404</p>
<p>The simple question is, can someone please explain exactly what that code does?</p></div>
<div class="smallfont" style="margin-bottom:2px;">
</div>
<div class="smallfont" style="margin-bottom:2px;">Sure!
</div>
<div class="smallfont" style="margin-bottom:2px;">
</div>
<div class="smallfont" style="margin-bottom:2px;">Code:</div>
<pre style="border:1px inset;overflow:auto;width:640px;height:34px;margin:0;padding:6px;">
<div style="text-align:left;" dir="ltr">RewriteBase /</div>
</pre>
</div>
<p>Says that all the rewriting will start from the directory the .htaccess file is located in</p>
<div style="margin:5px 20px 20px;">
<div class="smallfont" style="margin-bottom:2px;">Code:</div>
<pre style="border:1px inset;overflow:auto;width:640px;height:34px;margin:0;padding:6px;">
<div style="text-align:left;" dir="ltr">RewriteCond %{REQUEST_FILENAME} !-f</div>
</pre>
</div>
<p>Continues to next rewritecond if the requested file does not exist</p>
<div style="margin:5px 20px 20px;">
<div class="smallfont" style="margin-bottom:2px;">Code:</div>
<pre style="border:1px inset;overflow:auto;width:640px;height:34px;margin:0;padding:6px;">
<div style="text-align:left;" dir="ltr">RewriteCond %{REQUEST_FILENAME} !-d</div>
</pre>
</div>
<p>Continues to rewriterule if the requested file is not an existing directory</p>
<div style="margin:5px 20px 20px;">
<div class="smallfont" style="margin-bottom:2px;">Code:</div>
<pre style="border:1px inset;overflow:auto;width:640px;height:34px;margin:0;padding:6px;">
<div style="text-align:left;" dir="ltr">RewriteRule . /index.php [L]</div>
</pre>
</div>
<p>Rewrites any request with 1 or more characters to /index.php, which launches wordpress and handles all redirections and what to display</p>
<p>If you want the mydomain2 to be handled differently, create an .htaccess file in the mydomain2 sub-directory with its own errordocument. ie.</p>
<div style="margin:5px 20px 20px;">
<div class="smallfont" style="margin-bottom:2px;">Code:</div>
<pre style="border:1px inset;overflow:auto;width:640px;height:34px;margin:0;padding:6px;">
<div style="text-align:left;" dir="ltr">ErrorDocument 404 /mydomain2errors.php</div>
</pre>
</div>
<p>Or, alternatively, you can turn off the wordpress <a title="htaccess rewrite" href="http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html">htaccess rewriting</a> for that subdirectory.</p>
<div style="margin:5px 20px 20px;">
<div class="smallfont" style="margin-bottom:2px;">Code:</div>
<pre style="border:1px inset;overflow:auto;width:640px;height:194px;margin:0;padding:6px;">
<div style="text-align:left;" dir="ltr"># BEGIN WordPress
&#60;IfModule mod_rewrite.c&#62;
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/mydomain2subdirectory.*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&#60;/IfModule&#62;

# END WordPress</div>
</pre>
</div>
</div>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Access control with mod_rewrite]]></title>
<link>http://htaccessrewrite.wordpress.com/?p=6</link>
<pubDate>Mon, 02 Jun 2008 04:40:03 +0000</pubDate>
<dc:creator>wordpress htaccess</dc:creator>
<guid>http://htaccessrewrite.id.wordpress.com/2008/06/02/access-control-with-mod_rewrite/</guid>
<description><![CDATA[url rewriting using .htaccess to rewrite the url some day we&#8217;ll rewrite links to work without ]]></description>
<content:encoded><![CDATA[<p>url rewriting using .htaccess to rewrite the url some day we'll rewrite links to work without query strings like on askapache..</p>
<h3>Rewriting dynamic.php?id=12 to dynamic-12.html</h3>
<p>Redirection in which .php extension is hidden from the useragent’s address bar and dynamic url.<br />
code&#62;RewriteEngine on<br />
RewriteRule ^dynamic-([0-9]+)\.html$ dynamic.php?id=$1</code></p>
<h3>Rewriting dynamic.php?id=7 to dynamic/indexes-access/7.html</h3>
<p>Alwaysdisplay the main keyword in the URL. In the following URL rewriting technique you can display the name of the dynamic in URL.</p>
<p><code>RewriteEngine on<br />
RewriteRule ^dynamic/([a-zA-Z0-9_-]+)/([0-9]+)\.html$ dynamic.php?id=$2</code></p>
</h3>
<p>Redirecting non www URL to www URL</h3>
<p>If you type yahoo.com in useragent it will be redirected to www.yahoo.com. If you want to do same with your website then put the following code to .htaccess file. </p>
<blockquote><p>
What is benefit of this kind of redirection?? Please check the post about SEO friendly redirect (301) redirect in php and .htaccess.</p>
</blockquote>
<p><code>RewriteEngine On<br />
RewriteCond %{HTTP_HOST} ^htaccessrewrite\.com$<br />
RewriteRule (.*) http://www.htaccessrewrite.com/$1 [R=301,L]<br />
</code></p>
</h3>
<p>Redirecting the domain to a new subfolder of inside public_html.</h3>
<p>Now you can point both domains to /www/ directory as your DOC_ROOT.</p>
<p><code>RewriteEngine On<br />
RewriteCond %{HTTP_HOST} ^rewrite\.com$ [OR]<br />
RewriteCond %{HTTP_HOST} ^www\.rewrite\.com$<br />
RewriteCond %{REQUEST_URI} !^/www/<br />
RewriteRule (.*) /www/$1 </code></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[htaccess rewrite with FrontPage AND Permalinks]]></title>
<link>http://htaccessrewrite.wordpress.com/?p=3</link>
<pubDate>Mon, 02 Jun 2008 02:10:22 +0000</pubDate>
<dc:creator>wordpress htaccess</dc:creator>
<guid>http://htaccessrewrite.id.wordpress.com/2008/06/02/htaccess-rewrite-with-frontpage-and-permalinks/</guid>
<description><![CDATA[Normally, on a Unix server with the Microsoft FrontPage Server extensions installed WordPress works ]]></description>
<content:encoded><![CDATA[<p>Normally, on a Unix server with the Microsoft FrontPage Server extensions installed WordPress works just fine and you are able to edit and publish pages (with <span class="external text">Microsoft FrontPage</span>) — <strong>until</strong> — you make a change to the permalinks (for example to the date based kind that I like /2005/04/etc). I often suggest that type of URI to folks asking about permalinks etc, as that is the method recommended by the w3c (see <span class="external free">http://www.w3.org/Provider/Style/URI</span> ).</p>
<p>Now, the problem is that FrontPage uses the .htaccess file (which the WordPress mod_rewrite rules must access) for its "publishing" and "web authoring" configuration. As soon as the WordPress mod_rewrite code is added to the file, two things happen — the permalinks don't work and the Frontpage Server extensions become corrupt.</p>
<p>I have tried countless ways to get around this, including trying to use rewrite rules that "ignore" the <tt>%{HTTP_USERAGENT)%</tt> used by FrontPage, to using a second AccessFilename <tt>.wpaccess</tt> to the <tt>httpd.conf</tt> file, and a host of other things, and nothing worked to allow use of FrontPage <em>and</em> management and use of permalinks in WordPress at the same time.</p>
<p>The solution is actually simple, and I figured it out by accident.</p>
<p>If you are using, or wish to use FrontPage (or if your hosting package is pre-configured that way) along with WordPress, you'll need to take the following simple steps on your server or have your hosting company do them for you.</p>
<p>Microsoft FrontPage creates the following directory</p>
<pre>_vti_bin</pre>
<p>Nested within that it creates both</p>
<pre>_vti_adm</pre>
<p>and</p>
<pre>_vti_aut</pre>
<p>In addition to in your site (or WordPress) root folder in all of those directories you will find additional <tt>.htaccess</tt> files.</p>
<p>In all three of these directories AND in the root directory, at the top of ALL of the <tt>.htaccess</tt> files you simply need to add one line:</p>
<pre>Options +FollowSymlinks
</pre>
<p>There may or may not already be a line in each like</p>
<pre>Options None</pre>
<p>Edit and save each <tt>.htaccess</tt> file and you're done. Now everything works perfectly, including FrontPage, AND the permalinks of your choosing.</p>
]]></content:encoded>
</item>

</channel>
</rss>
