<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — rewrite rules]]></title>
		<link>https://punbb.informer.com/forums/topic/18548/rewrite-rules/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/18548/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in rewrite rules.]]></description>
		<lastBuildDate>Mon, 03 Mar 2008 12:57:39 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: rewrite rules]]></title>
			<link>https://punbb.informer.com/forums/post/110878/#p110878</link>
			<description><![CDATA[<p>Changed it into:</p><p>rewrite_rules.php<br /></p><div class="codebox"><pre><code>&#039;/^gallery(\.html?|\/)?$/i&#039;                             =&gt; &#039;index.php?gallery&#039;,
&#039;/^gallery[\/_-]album[\/_-]?(.*?|\/)(\.html?|\/)?$/i&#039;  =&gt; &#039;index.php?gallery=&amp;album=$1&#039;</code></pre></div><p>Folder_based.php<br /></p><div class="codebox"><pre><code>&#039;gallery&#039;        =&gt; &#039;gallery/&#039;,
&#039;gallery_album&#039;  =&gt; &#039;gallery/album/$1/&#039;</code></pre></div><p>And I had to change manifest.xml because all the scripts and css used PUN_ROOT and then with folder_based they did not load, changed it into $base_url.</p><p>Thanks for all the help daris <img src="https://punbb.informer.com/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (kierownik)]]></author>
			<pubDate>Mon, 03 Mar 2008 12:57:39 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/110878/#p110878</guid>
		</item>
		<item>
			<title><![CDATA[Re: rewrite rules]]></title>
			<link>https://punbb.informer.com/forums/post/110877/#p110877</link>
			<description><![CDATA[<p>rewrite_rules.php:<br /></p><div class="quotebox"><blockquote><p>$pun_rewrite_rules_gallery = array(<br />&nbsp; &#039;/^gallery(\.html<strong><span style="color: red">?|\/</span></strong>)?$/i&#039;&nbsp; &nbsp; &nbsp; &nbsp;=&gt; &#039;index.php?gallery=&#039;,<br />&nbsp; &#039;/^gallery[\/_-]album[\/_-]?(.*?)(\.html?|\/)?$/i&#039;&nbsp; =&gt; &#039;index.php?gallery=&amp;album=$1&#039;<br />);</p></blockquote></div><p>Folder_based.php:<br /></p><div class="quotebox"><blockquote><p>$pun_url_gallery = array(<br />&nbsp; &#039;gallery&#039;&nbsp; &nbsp; &nbsp; &nbsp; =&gt; &#039;gallery<strong><span style="color: red">/</span></strong>&#039;,<br />&nbsp; &#039;gallery_album&#039;&nbsp; =&gt; &#039;gallery/album/$1<strong><span style="color: red">/</span></strong>&#039;<br />);</p></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (daris)]]></author>
			<pubDate>Mon, 03 Mar 2008 12:33:55 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/110877/#p110877</guid>
		</item>
		<item>
			<title><![CDATA[Re: rewrite rules]]></title>
			<link>https://punbb.informer.com/forums/post/110875/#p110875</link>
			<description><![CDATA[<p>Thanks daris, it works <img src="https://punbb.informer.com/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>the only thing that does not work is folder_based.php, he does not seem to do something with / but he does with - <img src="https://punbb.informer.com/forums/img/smilies/hmm.png" width="15" height="15" alt="hmm" /></p>]]></description>
			<author><![CDATA[null@example.com (kierownik)]]></author>
			<pubDate>Mon, 03 Mar 2008 12:09:25 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/110875/#p110875</guid>
		</item>
		<item>
			<title><![CDATA[Re: rewrite rules]]></title>
			<link>https://punbb.informer.com/forums/post/110870/#p110870</link>
			<description><![CDATA[<p>I replaced:<br /></p><div class="quotebox"><blockquote><p>&#039;/^gallery[\/_-]album[\/_-]?(.*?)(\.html?|\/)?$/i&#039;&nbsp; =&gt; &#039;index.php?gallery&amp;gallery=$1&#039;</p></blockquote></div><p>with:<br /></p><div class="quotebox"><blockquote><p>&#039;/^gallery[\/_-]album[\/_-]?(.*?)(\.html?|\/)?$/i&#039;&nbsp; =&gt; &#039;index.php?gallery<strong><span style="color: red">=&amp;</span></strong>album=$1&#039;</p></blockquote></div><p>and it works <img src="https://punbb.informer.com/forums/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p><p>Simple method for check what is wrong:<br /></p><div class="codebox"><pre><code>echo &#039;&lt;pre&gt;&#039;;
print_r($_GET);
echo &#039;&lt;/pre&gt;&#039;;</code></pre></div><p>and it prints:<br /></p><div class="quotebox"><blockquote><p>Array<br />(<br />&nbsp; &nbsp; [gallery] =&gt; <br />&nbsp; &nbsp; [<strong><span style="color: red">amp;</span></strong>album] =&gt; Lytebox<br />)</p></blockquote></div><p>album is not set, amp;album is set <img src="https://punbb.informer.com/forums/img/smilies/wink.png" width="15" height="15" alt="wink" /> </p><p>It explode url by &quot;&amp;&quot;:<br /></p><div class="codebox"><pre><code>$query_string = explode(&#039;&amp;&#039;, $url_parts[1]);</code></pre></div><p>(60 line of rewrite_rules.php)</p>]]></description>
			<author><![CDATA[null@example.com (daris)]]></author>
			<pubDate>Mon, 03 Mar 2008 11:13:06 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/110870/#p110870</guid>
		</item>
		<item>
			<title><![CDATA[Re: rewrite rules]]></title>
			<link>https://punbb.informer.com/forums/post/110771/#p110771</link>
			<description><![CDATA[<p>Thanks for trying daris, I also tried your code but I am now using index.php?gallery&amp;album=$1</p><p>I tried to replace it in your code but I still do not get the album <img src="https://punbb.informer.com/forums/img/smilies/sad.png" width="15" height="15" alt="sad" /></p><p>[edit] version that I now use you can download here <a href="http://kierownik.nl/download.php?actie=bekijk&amp;id=13">http://kierownik.nl/download.php?actie=bekijk&amp;id=13</a></p>]]></description>
			<author><![CDATA[null@example.com (kierownik)]]></author>
			<pubDate>Sun, 02 Mar 2008 11:07:50 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/110771/#p110771</guid>
		</item>
		<item>
			<title><![CDATA[Re: rewrite rules]]></title>
			<link>https://punbb.informer.com/forums/post/110769/#p110769</link>
			<description><![CDATA[<p>I installed your extension, changed some code and it works. <a href="http://daris.hostsnake.com/files/gallery.txt">Here</a> is changed gallery.php file (between /***) and rewrite rule which i used:<br /></p><div class="quotebox"><blockquote><p>/^gallery[\/_-]album[\/_-]?(.*?)(\.html?|\/)?$/i&#039;&nbsp; =&gt; &#039;extensions/gallery/gallery.php?gallery=$1&#039;</p></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (daris)]]></author>
			<pubDate>Sun, 02 Mar 2008 10:55:00 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/110769/#p110769</guid>
		</item>
		<item>
			<title><![CDATA[Re: rewrite rules]]></title>
			<link>https://punbb.informer.com/forums/post/110757/#p110757</link>
			<description><![CDATA[<p>Yep now I see, changed it into:<br />&nbsp; &#039;/^gallery[\/_-]album[\/_-]?([A-Za-z0-9-]+).*(\.html?|\/)?$/i&#039;&nbsp; =&gt; &#039;index.php?gallery&amp;album=$1&#039;</p><p>but now going to <a href="http://pundemo.kierownik.nl/gallery-album-Lightbox.html">http://pundemo.kierownik.nl/gallery-album-Lightbox.html</a> will not show that album</p><p>phoe phoe, that sef url thing is more difficult than I thought <img src="https://punbb.informer.com/forums/img/smilies/roll.png" width="15" height="15" alt="roll" /></p><p>[edit] It seems that $_GET[&#039;album&#039;] cannot be found <img src="https://punbb.informer.com/forums/img/smilies/hmm.png" width="15" height="15" alt="hmm" /></p>]]></description>
			<author><![CDATA[null@example.com (kierownik)]]></author>
			<pubDate>Sun, 02 Mar 2008 02:10:58 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/110757/#p110757</guid>
		</item>
		<item>
			<title><![CDATA[Re: rewrite rules]]></title>
			<link>https://punbb.informer.com/forums/post/110756/#p110756</link>
			<description><![CDATA[<p>The link I&#039;m now seeing is<br /><a href="http://pundemo.kierownik.nl/gallery-album-Lightbox.html">http://pundemo.kierownik.nl/gallery-album-Lightbox.html</a><br />Do you see why that doesn&#039;t match the regex?</p>]]></description>
			<author><![CDATA[null@example.com (Smartys)]]></author>
			<pubDate>Sun, 02 Mar 2008 02:02:42 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/110756/#p110756</guid>
		</item>
		<item>
			<title><![CDATA[Re: rewrite rules]]></title>
			<link>https://punbb.informer.com/forums/post/110755/#p110755</link>
			<description><![CDATA[<p>changed it to<br />&nbsp; &#039;/^gallery_album[\/_-]?([A-Za-z0-9-]+).*(\.html?|\/)?$/i&#039;&nbsp; =&gt; &#039;index.php?gallery&amp;album=$1&#039;</p><p>but still get the Bad request <img src="https://punbb.informer.com/forums/img/smilies/hmm.png" width="15" height="15" alt="hmm" /></p>]]></description>
			<author><![CDATA[null@example.com (kierownik)]]></author>
			<pubDate>Sun, 02 Mar 2008 01:58:34 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/110755/#p110755</guid>
		</item>
		<item>
			<title><![CDATA[Re: rewrite rules]]></title>
			<link>https://punbb.informer.com/forums/post/110754/#p110754</link>
			<description><![CDATA[<p>Yes. Replace [0-9] there with [a-z]</p>]]></description>
			<author><![CDATA[null@example.com (Smartys)]]></author>
			<pubDate>Sun, 02 Mar 2008 01:49:04 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/110754/#p110754</guid>
		</item>
		<item>
			<title><![CDATA[Re: rewrite rules]]></title>
			<link>https://punbb.informer.com/forums/post/110753/#p110753</link>
			<description><![CDATA[<p>searched the web about arbitrary elements but could not find any good explanation for it in my language so I used <a href="http://babelfish.altavista.com/tr">http://babelfish.altavista.com/tr</a> that tells me that arbitrary elements are random elements. What I am then asking myself is, what elements.</p><p>I know that everyting looks like I want to, so too how the links should look like e.g. gallery/album/Lightbox but then after clicking I get the Bad request.</p><p>I think my mistake is in the line:<br />&nbsp; &#039;/^gallery_album[\/_-]?([0-9]+).*(\.html?|\/)?$/i&#039;&nbsp; =&gt; &#039;index.php?gallery?album=$1&#039;</p>]]></description>
			<author><![CDATA[null@example.com (kierownik)]]></author>
			<pubDate>Sun, 02 Mar 2008 01:45:23 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/110753/#p110753</guid>
		</item>
		<item>
			<title><![CDATA[Re: rewrite rules]]></title>
			<link>https://punbb.informer.com/forums/post/110752/#p110752</link>
			<description><![CDATA[<p>Aha<br /><a href="http://pundemo.kierownik.nl/gallery.html&amp;album=Lightbox">http://pundemo.kierownik.nl/gallery.htm … m=Lightbox</a><br />You shouldn&#039;t be adding arbitrary elements to the URL. You should be using pun_link for that.</p>]]></description>
			<author><![CDATA[null@example.com (Smartys)]]></author>
			<pubDate>Sun, 02 Mar 2008 01:29:34 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/110752/#p110752</guid>
		</item>
		<item>
			<title><![CDATA[Re: rewrite rules]]></title>
			<link>https://punbb.informer.com/forums/post/110751/#p110751</link>
			<description><![CDATA[<p>And what is the problem you&#039;re having?</p>]]></description>
			<author><![CDATA[null@example.com (Smartys)]]></author>
			<pubDate>Sun, 02 Mar 2008 01:27:51 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/110751/#p110751</guid>
		</item>
		<item>
			<title><![CDATA[Re: rewrite rules]]></title>
			<link>https://punbb.informer.com/forums/post/110744/#p110744</link>
			<description><![CDATA[<p>Latest SVN = 1537</p><p>rewrite_rules.php<br /></p><div class="codebox"><pre><code>&lt;?php

$pun_rewrite_rules_gallery = array(
  &#039;/^gallery(\.html)?$/i&#039;                             =&gt; &#039;index.php?gallery&#039;,
  &#039;/^gallery_album[\/_-]?([0-9]+).*(\.html?|\/)?$/i&#039;  =&gt; &#039;index.php?gallery?album=$1&#039;
);

$pun_rewrite_rules = array_merge($pun_rewrite_rules, $pun_rewrite_rules_gallery);</code></pre></div><p>Default.php<br /></p><div class="codebox"><pre><code>&lt;?php

// Make sure no one attempts to run this script &quot;directly&quot;
if (!defined(&#039;PUN&#039;))
  exit;

$pun_url_gallery = array(
  &#039;gallery&#039;       =&gt; &#039;index.php?gallery&#039;,
  &#039;gallery_album&#039; =&gt; &#039;index.php?gallery&amp;album=$1&#039;
);

$pun_url = array_merge($pun_url, $pun_url_gallery);</code></pre></div><p>File_based.php<br /></p><div class="codebox"><pre><code>&lt;?php

// Make sure no one attempts to run this script &quot;directly&quot;
if (!defined(&#039;PUN&#039;))
  exit;

$pun_url_gallery = array(
  &#039;gallery&#039;       =&gt; &#039;gallery.html&#039;,
  &#039;gallery_album&#039; =&gt; &#039;gallery.html&amp;album=$1&#039;
);

$pun_url = array_merge($pun_url, $pun_url_gallery);</code></pre></div><p>File_based_(fancy).php<br /></p><div class="codebox"><pre><code>&lt;?php

// Make sure no one attempts to run this script &quot;directly&quot;
if (!defined(&#039;PUN&#039;))
  exit;

$pun_url_gallery = array(
  &#039;gallery&#039;         =&gt; &#039;gallery.html&#039;,
  &#039;gallery_album&#039;  =&gt; &#039;gallery/album_$1.html&#039;
);

$pun_url = array_merge($pun_url, $pun_url_gallery);</code></pre></div><p>Folder_based.php<br /></p><div class="codebox"><pre><code>&lt;?php

// Make sure no one attempts to run this script &quot;directly&quot;
if (!defined(&#039;PUN&#039;))
  exit;

$pun_url_gallery = array(
  &#039;gallery&#039;        =&gt; &#039;gallery&#039;,
  &#039;gallery_album&#039;  =&gt; &#039;gallery/album/$1&#039;
);

$pun_url = array_merge($pun_url, $pun_url_gallery);</code></pre></div><div class="codebox"><pre><code>echo &quot;&lt;li class=\&quot;topactive\&quot;&gt;&lt;a href=\&quot;&quot;.pun_link ( $pun_url[&#039;gallery_album&#039;], array($li_gallery_name, sef_friendly ( $li_gallery_name ) ) ).&quot;\&quot;&gt;&lt;span&gt;&quot;.htmlentities ( $dir ).&quot;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&quot;;</code></pre></div><p>and $li_gallery_name gives the &amp;_GET[&#039;album&#039;]</p>]]></description>
			<author><![CDATA[null@example.com (kierownik)]]></author>
			<pubDate>Sat, 01 Mar 2008 23:37:13 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/110744/#p110744</guid>
		</item>
		<item>
			<title><![CDATA[Re: rewrite rules]]></title>
			<link>https://punbb.informer.com/forums/post/110743/#p110743</link>
			<description><![CDATA[<p>Try using the latest SVN. If it still doesn&#039;t work, repost all the code you&#039;re using now in your extension.</p>]]></description>
			<author><![CDATA[null@example.com (Smartys)]]></author>
			<pubDate>Sat, 01 Mar 2008 23:29:24 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/110743/#p110743</guid>
		</item>
	</channel>
</rss>
