<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : url mod_rewrite page_add bug</title>
		<link>https://www.cotonti.com</link>
		<description>Last topic posts</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Sat, 11 Apr 2026 06:42:18 -0000</pubDate>

		<item>
			<title>donP</title>
			<description><![CDATA[<blockquote><a href="https://www.cotonti.com/forums.php?m=posts&amp;p=23468#23468">#</a> <strong>Koradhil :</strong>
<pre class="code">RewriteCond %{HTTP_HOST} ^(&#091;A-Za-z0-9\-&#093;+).sangelo.net$ &#091;NC&#093;
RewriteRule ^(&#091;a-z\-&#093;+)$ list.php?c=$1 &#091;NE,NC,L,QSA&#093;</pre>
I'm pretty good with mod_rewrite, but it always requires testing and tweaking.<br />
</blockquote>
Your syntax doesn't take me to <strong>list.php?c=$1</strong> but to homepage...<br />
the right syntax was mine:<br />
<pre class="code">RewriteCond %{HTTP_HOST} !www.sangelo.net$ &#091;NC&#093;
RewriteCond %{HTTP_HOST} ^(&#091;A-Za-z0-9\-&#093;+).sangelo.net$ &#091;NC&#093;
RewriteRule (.*) list.php?c=%1 &#091;NE,NC,L,QSA&#093;</pre>
<br />
But my problem was not to first level, that I personally already solved like that...<br />
The problem is for second and third level, rewriting<br />
<strong>http://cat1.sangelo.net/subcat/</strong> redirecting to <strong>list.php?c=subcat</strong><br />
and<br />
<strong>http://cat.sangelo.net/subcat/subsubcat</strong>  redirecting to <strong>list.php?c=subsubcat</strong><br />
<br />
'cause a rule like the one below:<br />
<pre class="code">RewriteCond %{HTTP_HOST} ^(&#091;A-Za-z0-9\-&#093;+).sangelo.net/(&#091;A-Za-z0-9\-&#093;+)$ &#091;NC&#093;
RewriteRule (.*) list.php?c=%2 &#091;NE,NC,L,QSA&#093;</pre>
still redirects to <strong>list.php?c=cat</strong><br />
<br />
Personally I think it's a problem concerned with subdomain form in url, cause, also when rewriting <a href="http://cat.sangelo.net" rel="nofollow">http://cat.sangelo.net</a> (that right takes me to list.php?c=cat) I have problems in displaying images, cause .tpl files address images to /skin/skinname/img/imagefile.jpg, not to the complete domain url including <a href="http://www.sangelo.net..." rel="nofollow">http://www.sangelo.net...</a> so, also that is a real problem (I would have to correct all tpl files, hoping that we haven't too many hardcoded images that I would have to correct with core hacks)...]]></description>
			<pubDate>Thu, 11 Mar 2010 16:18:15 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=30#post23489]]></link>
		</item>
		<item>
			<title>pieter</title>
			<description><![CDATA[Is there some explaination on another site maybe about how these things work.<br />
<br />
<strong>^([A-Za-z0-9\-]+</strong><br />
I saw it also in bbcodes, but I don't have a clue what it really means.]]></description>
			<pubDate>Thu, 11 Mar 2010 15:22:06 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=30#post23486]]></link>
		</item>
		<item>
			<title>GHengeveld</title>
			<description><![CDATA[<pre class="code">RewriteCond %{HTTP_HOST} ^(&#091;A-Za-z0-9\-&#093;+).sangelo.net$ &#091;NC&#093;
RewriteRule ^(&#091;a-z\-&#093;+)$ list.php?c=$1 &#091;NE,NC,L,QSA&#093;</pre>
I'm pretty good with mod_rewrite, but it always requires testing and tweaking.]]></description>
			<pubDate>Thu, 11 Mar 2010 01:06:45 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=30#post23468]]></link>
		</item>
		<item>
			<title>donP</title>
			<description><![CDATA[I was able to modify function.custom.php like this:<br />
<div class="highlight"><pre class="php">function list_url_structure(&amp;$args)
{
	global $sed_cat;
	
	$url = str_replace('.', '/', $sed_cat&#091;$args&#091;'c'&#093;&#093;&#091;'path'&#093;).'/';
	unset($args&#091;'c'&#093;);
	
	$subdomain = substr($url, 0, strpos($url,&quot;/&quot;));
	$restofurl = substr($url, strpos($url,&quot;/&quot;)+1);
	return &quot;http://&quot;.$subdomain.&quot;.sangelo.net/&quot;.$restofurl;
}</pre></div>
so it returns <strong>cat.domain.net/subcat</strong>...<br />
<br />
Now I would find anyone to help me modifying .htacces from<br />
<pre class="code"># Level 3
RewriteRule ^(Parrocchia|Oratorio|SocietaSportiva|Scout|RnB|links|ECOComunita|news|Diari)/(&#091;a-z\-&#093;+)/(&#091;a-z\-&#093;+)/(&#091;0-9&#093;+)\.html page.php?id=$4 &#091;QSA,NC,NE,L&#093;
RewriteRule ^(Parrocchia|Oratorio|SocietaSportiva|Scout|RnB|links|ECOComunita|news|Diari)/(&#091;a-z\-&#093;+)/(&#091;a-z\-&#093;+)/add$ page.php?m=add&amp;c=$3 &#091;QSA,NC,NE,L&#093;
RewriteRule ^(Parrocchia|Oratorio|SocietaSportiva|Scout|RnB|links|ECOComunita|news|Diari)/(&#091;a-z\-&#093;+)/(&#091;a-z\-&#093;+)/(&#091;a-zA-Z0-9\-_&#093;+)\.html page.php?al=$4 &#091;QSA,NC,NE,L&#093;
RewriteRule ^(Parrocchia|Oratorio|SocietaSportiva|Scout|RnB|links|ECOComunita|news|Diari)/(&#091;a-z\-&#093;+)/(&#091;a-z\-&#093;+)/ list.php?c=$3 &#091;QSA,NC,NE,L&#093;

# Level 2
RewriteRule ^(Parrocchia|Oratorio|SocietaSportiva|Scout|RnB|links|ECOComunita|news|Diari)/(&#091;a-z\-&#093;+)/(&#091;0-9&#093;+)\.html page.php?id=$3 &#091;QSA,NC,NE,L&#093;
RewriteRule ^(Parrocchia|Oratorio|SocietaSportiva|Scout|RnB|links|ECOComunita|news|Diari)/(&#091;a-z\-&#093;+)/add$ page.php?m=add&amp;c=$2 &#091;QSA,NC,NE,L&#093;
RewriteRule ^(Parrocchia|Oratorio|SocietaSportiva|Scout|RnB|links|ECOComunita|news|Diari)/(&#091;a-z\-&#093;+)/(&#091;a-zA-Z0-9\-_&#093;+)\.html page.php?al=$3 &#091;QSA,NC,NE,L&#093;
RewriteRule ^(Parrocchia|Oratorio|SocietaSportiva|Scout|RnB|links|ECOComunita|news|Diari)/(&#091;a-z\-&#093;+)/ list.php?c=$2 &#091;QSA,NC,NE,L&#093;

# Level1
RewriteRule ^(Parrocchia|Oratorio|SocietaSportiva|Scout|RnB|links|ECOComunita|news|Diari)/(&#091;0-9&#093;+)\.html page.php?id=$2 &#091;QSA,NC,NE,L&#093;
RewriteRule ^(Parrocchia|Oratorio|SocietaSportiva|Scout|RnB|links|ECOComunita|news|Diari)/add$ page.php?m=add&amp;c=$1 &#091;QSA,NC,NE,L&#093;
RewriteRule ^(Parrocchia|Oratorio|SocietaSportiva|Scout|RnB|links|ECOComunita|news|Diari)/(&#091;a-zA-Z0-9\-_&#093;+)\.html page.php?al=$2 &#091;QSA,NC,NE,L&#093;
RewriteRule ^(Parrocchia|Oratorio|SocietaSportiva|Scout|RnB|links|ECOComunita|news|Diari)/ list.php?c=$1 &#091;QSA,NC,NE,L&#093;
</pre>
<br />
to the <strong>new rules</strong> to reflect my modifications in function.custom.php and give funcionality to my &quot;subdomains rewrite&quot;...<br />
<br />
<strong>Added 23 hours 47 minutes later:</strong><br />
<br />
I was good in redirecting to <a href="http://cat1.sangelo.net" rel="nofollow">http://cat1.sangelo.net</a> with this rule:<br />
<br />
<pre class="code">RewriteCond %{HTTP_HOST} ^(Parrocchia|Oratorio|SocietaSportiva|Scout|RnB|links|ECOComunita|news|Diari).sangelo.net &#091;NC&#093;
RewriteRule (.*) list.php?c=%1 &#091;L&#093; </pre>
<br />
but I'm not able to create second and third level of folder (e.g. htt://cat1.sangelo.net/subcat1/ and <a href="http://cat1.sangelo.net/subcat1/subsubcat1/" rel="nofollow">http://cat1.sangelo.net/subcat1/subsubcat1/</a> ) cause, using such a rule:<br />
<br />
<pre class="code">RewriteCond %{HTTP_HOST} ^(Parrocchia|Oratorio|SocietaSportiva|Scout|RnB|links|ECOComunita|news|Diari).sangelo.net/(&#091;a-z\-&#093;+)/ &#091;NC&#093;
RewriteRule (.*) list.php?c=%2 &#091;L&#093; </pre>
<br />
I obtain a 404 not found error, cause, as I can see from error log, that rewrite rule causes a <br />
<strong>File does not exist: /home/sangelon/public_html/subcat, referer: <a href="http://cat1.sangelo.net/" rel="nofollow">http://cat1.sangelo.net/</a></strong><br />
 <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/sad.gif" alt=":(" /><br /><br /><b>Added 20 hours 44 minutes later:</b><br /><br />Nobody can help me here... I think I must search on the web for an Apache mod_rewrite expert...]]></description>
			<pubDate>Sun, 07 Mar 2010 23:19:30 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=30#post23427]]></link>
		</item>
		<item>
			<title>GHengeveld</title>
			<description><![CDATA[Using a custom function for URL rewriting is a very powerful feature, but requires quite some skill and knowledge to apply correctly. I've never used it myself, so it's beyond my knowledge, even though I use the rewriting system a lot.<br /><br /><b>Added 24 minutes later:</b><br /><br />Come to think of it, I don't think it's possible to rewrite the main url, for editing the subdomain.<br />
<br />
You can still do it through .htaccess, but that won't really rewrite the url, only redirect the visitor so it seems to him there was a subdomain specified.<br />
- Cotonti rewrite to www.domain.com/cat/subcat<br />
- .htaccess rewrite www.domain.com/cat/subcat to cat.domain.com/subcat, with [R=301] specified<br />
- .htaccess rewrite cat.domain.com/subcat to www.domain.com/list.php?c=subcat without [R=301]]]></description>
			<pubDate>Sun, 07 Mar 2010 05:20:43 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=30#post23424]]></link>
		</item>
		<item>
			<title>donP</title>
			<description><![CDATA[Not mine  <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/confused.gif" alt=":/" /><br />
<br />
<strong>Added 20 hours 9 minutes later:</strong><br />
<br />
Seems to be a too complicated mission also for our good coders... <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/sad.gif" alt=":(" />]]></description>
			<pubDate>Fri, 05 Mar 2010 01:11:19 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post23410]]></link>
		</item>
		<item>
			<title>tensh</title>
			<description><![CDATA[<blockquote><a href="https://www.cotonti.com/forums.php?m=posts&amp;p=23405#23405">#</a> <strong>donP :</strong>
Now every word I write in url as a third level domain (e.g. <a href="http://sport.sangelo.net)" rel="nofollow">http://sport.sangelo.net)</a> gives me the home page of my website. I think this is the right way, no?<br />
</blockquote>
<br />
It's quite normal in some webhost configurations even without htaccess, I think.]]></description>
			<pubDate>Thu, 04 Mar 2010 22:56:43 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post23408]]></link>
		</item>
		<item>
			<title>donP</title>
			<description><![CDATA[I've created a CNAME <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/wink.gif" alt=";)" /> Thank you Koradhil (ar you back to Cotonti? I'd hope this).<br />
Now every word I write in url as a third level domain (e.g. <a href="http://sport.sangelo.net)" rel="nofollow">http://sport.sangelo.net)</a> gives me the home page of my website. I think this is the right way, no?<br />
Now, considering I'm not a good script coder, could anyone help me to rewrite Trustmaster function.custom.php and .htaccess rules to have the first level category of page strucrture as the name of the third level domain and not the first subfolder like in the actual solution? Like this:<br />
<br />
<span style="color:#4E9A06">Instead of (actual method):<br />
<br />
<a href="http://www.mysite.net/list.php?c=cat1" rel="nofollow">http://www.mysite.net/list.php?c=cat1</a> ==&gt; <a href="http://www.mysite.net/cat1/" rel="nofollow">http://www.mysite.net/cat1/</a><br />
<a href="http://www.mysite.net/list.php?c=subcat1" rel="nofollow">http://www.mysite.net/list.php?c=subcat1</a> ==&gt; <a href="http://www.mysite.net/cat1/subcat1/" rel="nofollow">http://www.mysite.net/cat1/subcat1/</a><br />
<a href="http://www.mysite.net/list.php?c=subsubcat1" rel="nofollow">http://www.mysite.net/list.php?c=subsubcat1</a> ==&gt; <a href="http://www.mysite.net/cat1/subcat1/subsubcat1/" rel="nofollow">http://www.mysite.net/cat1/subcat1/subsubcat1/</a><br />
...<br />
<br />
like this:<br />
<br />
<a href="http://www.mysite.net/list.php?c=cat1" rel="nofollow">http://www.mysite.net/list.php?c=cat1</a> ==&gt; <a href="http://cat1.mysite.net" rel="nofollow">http://cat1.mysite.net</a><br />
<a href="http://www.mysite.net/list.php?c=subcat1" rel="nofollow">http://www.mysite.net/list.php?c=subcat1</a> ==&gt; <a href="http://cat1.mysite.net/subcat1/" rel="nofollow">http://cat1.mysite.net/subcat1/</a><br />
<a href="http://www.mysite.net/list.php?c=subsubcat1" rel="nofollow">http://www.mysite.net/list.php?c=subsubcat1</a> ==&gt; <a href="http://cat1.mysite.net/subcat1/subsubcat1/" rel="nofollow">http://cat1.mysite.net/subcat1/subsubcat1/</a><br />
...</span><br />
<br />
Is it possible?]]></description>
			<pubDate>Thu, 04 Mar 2010 18:40:22 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post23405]]></link>
		</item>
		<item>
			<title>GHengeveld</title>
			<description><![CDATA[Most registrars provide a control panel for DNS settings. cPanel has it also, but this is often disabled by the host. You have to add an A record for *.sangelo.net =&gt; server IP. Alternatively, a CNAME will probably work as well: *.sangelo.net =&gt; sangelo.net]]></description>
			<pubDate>Thu, 04 Mar 2010 17:17:01 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post23404]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[www is a very usual configuration, but you need *]]></description>
			<pubDate>Wed, 03 Mar 2010 01:48:22 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post23358]]></link>
		</item>
		<item>
			<title>donP</title>
			<description><![CDATA[My Server is already capable to redirect <a href="http://sangelo.net" rel="nofollow">http://sangelo.net</a> to <a href="http://www.sangelo.net" rel="nofollow">http://www.sangelo.net</a><br />
Is it a good sign in that sense?]]></description>
			<pubDate>Wed, 03 Mar 2010 01:15:45 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post23357]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[It should be provided by your domain registrar or hosting control panel. You may contact your hosting support asking how you make generic subdomains to redirect to your main site.]]></description>
			<pubDate>Wed, 03 Mar 2010 00:45:00 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post23355]]></link>
		</item>
		<item>
			<title>donP</title>
			<description><![CDATA[And <strong>what have I to do</strong> to configure my domainzone to make working those &quot;fake&quot; subdomains?<br />
Have I to contact my hosting Provider or is it a trick I can personally do (by cPanel or htacces)?]]></description>
			<pubDate>Tue, 02 Mar 2010 22:43:16 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post23351]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[Your domain zone should be configured to forward *.mysite.com to the main site first, otherwise such &quot;fake&quot; subdomains won't work.]]></description>
			<pubDate>Tue, 02 Mar 2010 22:25:37 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post23350]]></link>
		</item>
		<item>
			<title>donP</title>
			<description><![CDATA[I've tried Lombi's solution ( <a href="http://www.cotonti.com/forums.php?m=posts&amp;q=2509">http://www.cotonti.com/forums.php?m=posts&amp;q=2509</a> ) but unfortunately, when I rewrite<br />
<a href="http://www.sangelo.net/list.php?c=category1" rel="nofollow">http://www.sangelo.net/list.php?c=category1</a><br />
with<br />
<a href="http://category1.sangelo.net" rel="nofollow">http://category1.sangelo.net</a><br />
my Server redirects me to a courtesy page <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/sad.gif" alt=":(" /> What's the problem?  <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/confused.gif" alt=":/" /><br />
<br />
<strong>Added 16 minutes later:</strong><br />
<br />
<br />
<span style="color:#A40000">In the end, I would have a new method deriverd from your one (to create fake subdomains taking domaniname from the fisrt category of categories structure)...<br />
<br />
Instead of (your actual method):<br />
<br />
<a href="http://www.mysite.net/list.php?c=cat1" rel="nofollow">http://www.mysite.net/list.php?c=cat1</a>  ==&gt; <a href="http://www.mysite.net/cat1/" rel="nofollow">http://www.mysite.net/cat1/</a><br />
<a href="http://www.mysite.net/list.php?c=subcat1" rel="nofollow">http://www.mysite.net/list.php?c=subcat1</a>  ==&gt; <a href="http://www.mysite.net/cat1/subcat1/" rel="nofollow">http://www.mysite.net/cat1/subcat1/</a><br />
<a href="http://www.mysite.net/list.php?c=subsubcat1" rel="nofollow">http://www.mysite.net/list.php?c=subsubcat1</a>  ==&gt; <a href="http://www.mysite.net/cat1/subcat1/subsubcat1/" rel="nofollow">http://www.mysite.net/cat1/subcat1/subsubcat1/</a><br />
...<br />
<br />
like this:<br />
<br />
<a href="http://www.mysite.net/list.php?c=cat1" rel="nofollow">http://www.mysite.net/list.php?c=cat1</a>  ==&gt; <a href="http://cat1.mysite.net" rel="nofollow">http://cat1.mysite.net</a><br />
<a href="http://www.mysite.net/list.php?c=subcat1" rel="nofollow">http://www.mysite.net/list.php?c=subcat1</a>  ==&gt; <a href="http://cat1.mysite.net/subcat1/" rel="nofollow">http://cat1.mysite.net/subcat1/</a><br />
<a href="http://www.mysite.net/list.php?c=subsubcat1" rel="nofollow">http://www.mysite.net/list.php?c=subsubcat1</a>  ==&gt; <a href="http://cat1.mysite.net/subcat1/subsubcat1/" rel="nofollow">http://cat1.mysite.net/subcat1/subsubcat1/</a><br />
<br />
Is it possible?</span>]]></description>
			<pubDate>Tue, 02 Mar 2010 21:38:51 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post23348]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[You need to modify list_url_structure() in functions.custom.php and add some logic checking $args['c'] and returning absolute urls for your subdomain categories.]]></description>
			<pubDate>Tue, 02 Mar 2010 16:38:06 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post23332]]></link>
		</item>
		<item>
			<title>donP</title>
			<description><![CDATA[Seems to work now... Thanks <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/wink.gif" alt=";)" /><br />
<br />
What about if I would have a different rule for one category, like this:<br />
<br />
list.php?c=Category1   ==&gt;   <a href="http://Category1.mydomain.net" rel="nofollow">http://Category1.mydomain.net</a><br />
list.php?c=subcategory1   ==&gt;   <a href="http://Category1.mydomain.net/subcategory1" rel="nofollow">http://Category1.mydomain.net/subcategory1</a><br />
list.php?c=subsubcategory1   ==&gt;   <a href="http://Category1.mydomain.net/subcategory1/subsubcategory1" rel="nofollow">http://Category1.mydomain.net/subcategory1/subsubcategory1</a><br />
<br />
But only for some categories (living the other rules like now, with the intent of creating a fake subdomain for one or two categories of my website).<br /><br /><b>Added 1 day later:</b><br /><br />Nobody here? <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/sad.gif" alt=":(" />]]></description>
			<pubDate>Mon, 01 Mar 2010 03:35:49 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post23293]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[I can make a plugin to rewrite relative links in pages and posts, but it won't be recommended for sites which don't already have many of old-way urls in posts.<br /><br /><b>Added 17 minutes later:</b><br /><br />I see the problem about your plugin now. It uses $out['uri']:<br />
<div class="highlight"><pre class="php">$area_location = substr($out&#091;'uri'&#093;, 0, strpos($out&#091;'uri'&#093;, '.'));</pre></div>
Which is incorrect, because $out['uri'] depends on exact way of URL output.<br />
The more correct way to get current area is:<br />
<div class="highlight"><pre class="php">global $z;
$area_location = $z;</pre></div>]]></description>
			<pubDate>Fri, 12 Feb 2010 04:09:31 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22847]]></link>
		</item>
		<item>
			<title>donP</title>
			<description><![CDATA[Yes, for menu slots it's quite simple, but I think pages and forum post (othewise parsing process) would be automatic. And the problem returns for sitemap (I'm actually using <a href="http://www.t3-design.com/t3-gensitemap/" rel="nofollow">Tefra GenSiteMap</a>)...]]></description>
			<pubDate>Wed, 10 Feb 2010 20:51:55 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22816]]></link>
		</item>
		<item>
			<title>pieter</title>
			<description><![CDATA[In menuslots you can change it yourself by hand. Link you did before.<br />
Menuslots are not generated automatically.]]></description>
			<pubDate>Wed, 10 Feb 2010 02:27:23 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22799]]></link>
		</item>
		<item>
			<title>donP</title>
			<description><![CDATA[1) Thank you (althought I didn't need that part cause we don't use <strong>docs</strong> rewrite part)<br />
<br />
2) Now it's clear<br />
<br />
3) I changed with <strong>RewrtiteBase</strong><br />
<br />
4) This is a real problem, cause webBots are ravenous with links in pages, and we would think about a parsing solution to use url_rewriting method also in pages and menu slots<br />
<br />
5) So, we wouldn't use user part of the script, for now...<br />
<br />
6) I really can't understand, but, unfortunately I can't test in local cause (I don't know the reason) my wampserver goes crazy if I try to use url_rewriting...<br />
<br />
So, if you had time to look at the code, this is my plugin:<br />
<div style="margin:4px 0px 4px 0px"><input type="button" value="click here to view the code" onclick="if(this.parentNode.getElementsByTagName('div')[0].style.display != '') { this.parentNode.getElementsByTagName('div')[0].style.display = ''; } else { this.parentNode.getElementsByTagName('div')[0].style.display = 'none'; }" /><div style="display:none" class="spoiler">
<strong>headerchange.setup.php</strong><br />
<div class="highlight"><pre class="php">&lt;?PHP
/* ====================
COTONTI - Website engine
Copyright COTONTI
<a href="http://www.cotonti.com">http://www.cotonti.com</a>

&#091;BEGIN_SED&#093;
File=plugins/headerchange/headerchange.setup.php
Version=1
Updated=2009/08/04
Type=Plugin
Author=donP
&#091;END_SED&#093;

&#091;BEGIN_SED_EXTPLUGIN&#093;
Code=headerchange
Name=headerchange
Description=Plugin that changes background image and text string in header.tpl accordingly to category or other parameters
Version=1
Date=2009/08/04
Author=donP
Copyright=www.sangelo.net
Auth_guests=R
Lock_guests=W12345A
Auth_members=R
Lock_members=12345
Notes=Syntax is divided by two parts &lt;strong&gt;url:logo&lt;/strong&gt;&lt;br /&gt;URL can be: flat url (but only from root), single php file name, category code or a number eg. for forum sections and topics (look for logochanger.config.gif in plugin archive to see example configuration). In logo part, all paths can be from root or from skin selected folder. So you can use logo with path from root to skin folder (eg. skins/myskin/img/mylogo01.jpg) or you can use logo without path at all (then current skin folder will be used eg. mylogo01.jpg or img/mylogo01.jpg) Don't use full paths (with <a href="http://)" rel="nofollow">http://)</a> in any of url:logo. If some url/php-module/category/fsection/ftopic was not specified, then default logo will be returned.
&#091;END_SED_EXTPLUGIN&#093;

&#091;BEGIN_SED_EXTPLUGIN_CONFIG&#093;
deflogo=01:string:::Default logo
logos=02:text:::URL and Logo
&#091;END_SED_EXTPLUGIN_CONFIG&#093;
==================== */

defined('SED_CODE') or die('Wrong URL');

?&gt;</pre></div>
<br />
<strong>headerchange.php</strong><br />
<div class="highlight"><pre class="php">&lt;?PHP
/* ====================
COTONTI - Website engine
Copyright COTONTI
<a href="http://www.cotonti.com">http://www.cotonti.com</a>

&#091;BEGIN_SED&#093;
File=plugins/headerchange/headerchange.php
Version=1
Updated=2009/08/04
Type=Plugin
Author=donP
Description=Plugin that changes background and text string in header.tpl accordingly to category or other parameters
&#091;END_SED&#093;

&#091;BEGIN_SED_EXTPLUGIN&#093;
Code=headerchange
Part=Header
File=headerchange
Hooks=header.tags
Tags=header.tpl:{LOGOCHANGER}, {LOGOBANNER}
Minlevel=0
Order=10
&#091;END_SED_EXTPLUGIN&#093;
==================== */

defined('SED_CODE') or die('Wrong URL');

if (!$logo or count($logo) &lt; 4)
  {
  $logo = explode(&quot;\r\n&quot;, $cfg&#091;'plugin'&#093;&#091;'headerchange'&#093;&#091;'logos'&#093;);
  sed_cache_store('logo',$logo,3600);
  }
/* ------------------ */

	$t-&gt;assign(array(
    &quot;LOGOCHANGER&quot; =&gt; substr(logochanger_get_logo($logo), 0, strpos(logochanger_get_logo($logo),&quot;&#091;&quot;)),
    &quot;LOGOBANNER&quot; =&gt; substr(logochanger_get_logo($logo), strpos(logochanger_get_logo($logo),&quot;&#091;&quot;)+1)
    ));

function logochanger_get_logo($logo)
	{
    global $cfg, $db_pages, $out;

    foreach($logo as $key =&gt; $val)
	{
		$pos = strpos($val, ':');
		$selector&#091;0&#093; = substr($val, 0, $pos);	// url
		$selector&#091;1&#093; = substr($val, 0, 2);		// selector name
		$selector&#091;2&#093; = substr($val, 2, $pos-2);	// selector param
		$selector&#091;3&#093; = substr($val, $pos+1);	// logo+banner

		// based on URL (with dot)
		if(!(strpos($selector&#091;0&#093;, '.') === false))
		{
			if(!(strpos($out&#091;'uri'&#093;, $selector&#091;0&#093;) === false))
			return logochanger_check_path($selector&#091;3&#093;);
		}

		// Others (without dot in URL)
		else
		{
			switch($selector&#091;1&#093;)
			{

			// based on CATEGORY CODE
			case 'c=': 
				$al = sed_import('al','G','ALP', 64);
				$c  = sed_import('c','G','STX', 64);

			// get the area location
			$area_location = substr($out&#091;'uri'&#093;, 0, strpos($out&#091;'uri'&#093;, '.'));

			if(!empty($c) &amp;&amp; ($area_location=='index' || $area_location=='list'))
				{
					if($c == $selector&#091;2&#093;) return logochanger_check_path($selector&#091;3&#093;);
				}
			switch($area_location)
				{
				case 'page':
					$id = sed_import('id','G','INT');
					if(!empty($al)) $sql = sed_sql_query(&quot;SELECT page_cat FROM $db_pages WHERE page_alias='$al' LIMIT 1&quot;);
					else			$sql = sed_sql_query(&quot;SELECT page_cat FROM $db_pages WHERE page_id='$id' LIMIT 1&quot;);
					$pag = sed_sql_fetcharray($sql);
					if($pag&#091;'page_cat'&#093; == $selector&#091;2&#093;) return logochanger_check_path($selector&#091;3&#093;);
				break;

				case 'forum':
					if(sed_import('s','G','INT') == $selector&#091;2&#093;) return logochanger_check_path($selector&#091;3&#093;);
			    break;
			
				if(sed_import('q','G','INT') == $selector&#091;2&#093;) return logochanger_check_path($selector&#091;3&#093;);
				break;

			//case 'list':
			default:
					if($c == $selector&#091;2&#093;) return logochanger_check_path($selector&#091;3&#093;);
				}
			break;
			}
		}
	}
	return logochanger_check_path($cfg&#091;'plugin'&#093;&#091;'headerchange'&#093;&#091;'deflogo'&#093;);
}
/* ------------------ */

function logochanger_check_path($logo)
{
	global $skin;
	if(strpos($logo, 'skins/') === false) $logo = 'skins/'.$skin.'/img/'.$logo;
	return $logo;
}
?&gt;</pre></div></div></div>]]></description>
			<pubDate>Wed, 10 Feb 2010 01:46:24 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22798]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[1) I have reuploaded a <a href="http://www.cotonti.com/datas/users/coturl_2010-02_5.7z">fixed version</a><br />
<br />
2) Because in docs here category code is split by dashes: <em>docs-en-user</em> becomes <em>docs/en/user</em>. In other categories (e.g. <em>downloads</em>) subcategories have simple codes like <em>plugins</em>.<br />
<br />
3) Sorry. How did you change it?<br />
<br />
4) You're right, it does not rewrite static text. Static text should use new links.<br />
<br />
5) Yes, it has bugs so it is not recommended to use.<br />
<br />
6) Can I test your plugin to see the reason?]]></description>
			<pubDate>Tue, 09 Feb 2010 17:13:43 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22791]]></link>
		</item>
		<item>
			<title>donP</title>
			<description><![CDATA[Thanks for the example but...<br />
<br />
1) functions.custom.php uses eregi() that is deprecated from PHP 5.3.0<br />
<br />
2) I don't  understand why docs have different rewriting rules  <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/confused.gif" alt=":/" /> <br />
<br />
3) I had to change RewriteRuleBase at the beginning of .htaccess cause it generated a 500 internal Server Error<br />
<br />
4) url_rewrite doesn't rewrite links in menu slots and links in pages (parsed text)<br />
<br />
5) users rewriting causes me many problems<br />
<br />
6) list.php?c= rewriting is transparent to my <em>headerchanger</em> plugin, instead page.php?id= and page.php?al= not at all...]]></description>
			<pubDate>Tue, 09 Feb 2010 16:29:11 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22790]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[I have uploaded <a href="http://www.cotonti.com/datas/users/coturl_2010-01_5.7z">an example</a> of current files used on this site. Add problem is fixed there, except for problems with Wiki plugin.]]></description>
			<pubDate>Tue, 09 Feb 2010 01:54:50 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22781]]></link>
		</item>
		<item>
			<title>donP</title>
			<description><![CDATA[I have to investigate if I have the ability to check my webserver logs (I have Analog Stats in cPanel: is this the right tool? And is it a real time tool? Or I have to wait till next day, cause it would be too difficult to analize)... but that is not only a problem of mine... Many users have got it...]]></description>
			<pubDate>Mon, 08 Feb 2010 22:14:56 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22779]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[Could you check your webserver logs please? We need to know if it redirects to /page.php?id=123 or /category/that/is/not/real/page.php?id=123]]></description>
			<pubDate>Fri, 29 Jan 2010 00:43:31 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22433]]></link>
		</item>
		<item>
			<title>donP</title>
			<description><![CDATA[The form button in page_add module points to <strong>page.php?m=add&amp;a=add</strong>...<br />
The problem is that, nomral users pages go to validation queue and redirection points to index.php; Admins pages - instead - go to database directly and redirection points immediatly to page.php?id=#(the new inserted page ID). This is bad interpreted by url_rewrite engine I think, so a &quot;930 bad url message&quot; has returned.]]></description>
			<pubDate>Thu, 28 Jan 2010 23:47:14 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22431]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[Can you somehow notice the url which are you redirected from?]]></description>
			<pubDate>Thu, 28 Jan 2010 22:11:00 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22428]]></link>
		</item>
		<item>
			<title>donP</title>
			<description><![CDATA[Yes  <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/sad.gif" alt=":(" />]]></description>
			<pubDate>Thu, 28 Jan 2010 21:44:01 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22425]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[Is {HEADER_BASEHREF} present in your header.tpl?]]></description>
			<pubDate>Thu, 28 Jan 2010 21:24:31 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22421]]></link>
		</item>
		<item>
			<title>donP</title>
			<description><![CDATA[<blockquote><a href="https://www.cotonti.com/forums.php?m=posts&amp;p=22191#22191">#</a> <strong>Gökhan YILDIZ :</strong>
<pre class="code">RewriteRule ^(articles|news|videos|bla|bla2|bla3)/(&#091;a-z-&#093;+)/add$ page.php?m=add</pre>
</blockquote>
<br />
<span style="color:#A40000"><strong>Nothing to do with this and nothing also with Trustmaster one...</strong></span><br />
<br />
<strong>The only way I find was putting</strong><br />
<pre class="code">page	id=*	{page_url_structure()}
page	al=*	{page_url_structure()}    /*because page	al=*|id=*	{page_url_structure()} doesn't work  <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/confused.gif" alt=":/" /> */</pre>
<br />
<strong>in <span style="color:#CC0000">datas/ultrans.dat</span> instead of</strong><br />
<pre class="code">page	*	{page_url_structure()}</pre>
<br />
so the <strong>page.php?m=add&amp;c=...</strong> hasn't rewritten anymore, <span style="color:#CC0000"><strong>BUT</strong></span>... there <strong><span style="text-decoration:underline">still a problem</span></strong>: in this way the page has successfully added to the database, but a user with category-related admin rights receives a <span style="text-decoration:underline">930 redirect error message</span> saying the operation isn't allowed... this error doesn't happen when a level 1 users inserts a new page (and that page goes to validation queue)...<br />
<br />
what's the matter?  <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/confused.gif" alt=":/" /><br /><br /><b>Added 8 days later:</b><br /><br />Noone here to answer this?  <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/sad.gif" alt=":(" />]]></description>
			<pubDate>Wed, 20 Jan 2010 09:40:22 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22197]]></link>
		</item>
		<item>
			<title>Gökhan YILDIZ</title>
			<description><![CDATA[<pre class="code">RewriteRule ^(articles|news|videos|bla|bla2|bla3)/(&#091;a-z-&#093;+)/add$ page.php?m=add</pre>]]></description>
			<pubDate>Wed, 20 Jan 2010 05:51:24 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22191]]></link>
		</item>
		<item>
			<title>donP</title>
			<description><![CDATA[So, if I have 100 among categories and sublevel of category (I think so), must I have to make <span style="color:#EF2929"><strong>100 RewriteConditions</strong></span>?!  <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/surprised.gif" alt=":O" /> <br />
Isn't there a way to modify <strong>{page_url_structure()}</strong> function so it can to handle the <strong>m=add</strong> parameter outputting a right url?]]></description>
			<pubDate>Wed, 20 Jan 2010 02:23:23 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22189]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[docs/ here is a root-level category we provide our &quot;wonderful urls&quot; for. The above rule provides &quot;add&quot; rule for 2 levels of categories nested in docs. So, normally you should provide such a rule for every level of nesting. E.g. for 2 levels of nesting in category &quot;foo&quot; and 3 levels of nesting in &quot;bar&quot; it would be:<br />
<pre class="code">foo/(&#091;a-z-&#093;+)/(&#091;a-z-&#093;+)/add$ page.php?m=add&amp;c=foo-$1-$2
foo/(&#091;a-z-&#093;+)/add$ page.php?m=add&amp;c=foo-$1
bar/(&#091;a-z-&#093;+)/(&#091;a-z-&#093;+)/(&#091;a-z-&#093;+/add$ page.php?m=add&amp;c=bar-$1-$2-$3
bar/(&#091;a-z-&#093;+)/(&#091;a-z-&#093;+)/add$ page.php?m=add&amp;c=bar-$1-$2
bar/(&#091;a-z-&#093;+)/add$ page.php?m=add&amp;c=bar-$1</pre>]]></description>
			<pubDate>Tue, 19 Jan 2010 21:36:11 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22183]]></link>
		</item>
		<item>
			<title>donP</title>
			<description><![CDATA[In <a href="http://www.cotonti.com/docs/en/admin/url_modification">Kilandor detailed Guide</a> many users comments remark the bug with page_add...<br />
<br />
Kilandor answer like this:<br />
<br />
<blockquote><strong>Kilandor:</strong><hr />Modify .htaccess rules so that it looks for /add at the end of the URL, for example:<br />
<pre class="code">docs/(&#091;a-z-&#093;+)/(&#091;a-z-&#093;+)/add$ page.php?m=add&amp;c=docs-$1-$2</pre></blockquote>
<br />
But I ask:<br />
But... have I to write such a similiar line for <strong>every</strong> category and subcatecory of my site?!?! <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/surprised.gif" alt=":O" /><br />
<br />
Any explainations? <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/sad.gif" alt=":(" /> <br />
Thank you]]></description>
			<pubDate>Tue, 19 Jan 2010 19:13:46 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=5170&d=0#post22177]]></link>
		</item>
	</channel>
</rss>