Forums / Cotonti / Support / Tags issue with mod_rewrite

An interesting problem.

aiwass
#1 2011-01-27 18:16
Hi guys!

I have a really strange and puzzling problem with tags on my website, but first I should tell you that it's been mod_rewrite applied and it works, except one tag that just won't play along.

The problem tag is this one:
2manydjs = http://www.megamind.se/tags/pages/2manydjs/
it returns a 403 - Forbidden (#403)
You don't have permission to access the requested directory or URL that you requested.
Please inform the administrator of the referring page, if you think this was a mistake.

Redirecting...

YET, these tags below which also contain numbers are working just fine:
2000 And One / 2020vision recordings / 4 strings / an21 / X-Press 2 / cr2 records / 2Nd Society / dj02 / talla 2xlc / 2 Devine / 2 Fabiola and a hundred or so more

The mod_rewrite for tags looks like this and is working brilliantly for my 14,899 tags except one...
.htaccess
RewriteEngine On
RewriteBase /
RewriteRule ^(datas|images|js|skins)/(.*)$ $1/$2 [QSA,NC,NE,L]
RewriteRule ^([^/&?#]+)/([^/&?#]+)/(.*)$ page.php?c=$1&al=$2$3 [QSA,NC,NE,L]
RewriteRule ^list/([^/&?#]+)(.*)$ list.php?c=$1$2 [QSA,NC,NE,L]
RewriteRule ^xml/([^/&?#]+)(.*)$ xml.php?c=$1$2 [QSA,NC,NE,L]
RewriteRule ^search/([^/&?#]+)/(.*)$ plug.php?tab=$1&?e=search$2 [QSA,NC,NE,L]
RewriteRule ^tags/([^/&?#]+)/([^/&?#]+)/(.*)$ plug.php?a=$1&t=$2&e=tags$3 [QSA,NC,NE,L]
RewriteRule ^contactus(.*)$ plug.php?e=contactus$1 [QSA,NC,NE,L]
RewriteRule ^rss/([^/&?#]+)(.*)$ rss.php?c=$1$2 [QSA,NC,NE,L]
RewriteRule ^list/([^/&?#]+)/(.*)$ list.php?c=$1$2 [QSA,NC,NE,L]
RewriteRule ^([^/&?#]+)/([^/&?#]+)(.*)$ page.php?c=$1&al=$2$3 [QSA,NC,NE,L]

urltrans.dat
page	al=*	{$c}/{$al}/
list	c=*	{$_area}/{$c}
xml	c=*	{$_area}/{$c}
plug	?e=search&tab=*	search/{$tab}/
plug	e=tags&a=*&t=*	tags/{$a}/{$t}/
plug	e=contactus	contactus
rss	c=*	{$_area}/{$c}
list	c=*	{$_area}/{$c}/
page	al=*	{$c}/{$al}
*	*	{$_area}.php

Any idea why ONE tag is behaving strange, when others with numbers don't?
Thanks for any advice.

Added 29 minutes later:

Update

I found out what is causing the problem and it's even stranger.

The problem was that I have tags all ending with "djs" like plump djs, sedition djs, 2manydjs, but when I removed the last "s" in "djs" it works, which is a bit strange since the search term is "2manydjs" or "plump djs" not "*djs". Is it a bug or is "s" some sort of holy cow in the tags system?
Take all that money that we spend on weapons and defences each year and instead spend it feeding and clothing and educating the poor of the world, which it would many times over, not one human being excluded, and we could explore space, together, both inner and outer, forever, in peace. - Bill Hicks

https://evlear.com

Dit bericht is bewerkt door aiwass (2011-01-27 18:45, 13 jaren ago)
pieter
#2 2011-01-27 20:05
how is the name enterered?
How do you create the aliases?
automatically?

2 many dj's ---->> 2manydjs?
It is not the ending "s" because 4 strings works.

Maybe it has something to do with the ' before the s. Maybe the alias as wrongly made.
... can we help you ...
aiwass
#3 2011-01-27 20:12
All tags are entered manually when creating the page and aliases are also created manually, since I don't have faith in it being correct. If I were to create aliases automatic, I would ensure that no ' ` ´ or " are in the title field.

It only affected tags ending with "djs", but I've altered them all so that they now end with "dj" instead like "plump djs" > "plump dj" etc.
Take all that money that we spend on weapons and defences each year and instead spend it feeding and clothing and educating the poor of the world, which it would many times over, not one human being excluded, and we could explore space, together, both inner and outer, forever, in peace. - Bill Hicks

https://evlear.com
Trustmaster
#4 2011-01-28 03:45
This might be caused by the order of .htaccess rules. Specified rules should go before generic rules, so more correct order is:
RewriteEngine On
RewriteBase /
RewriteRule ^(datas|images|js|skins)/(.*)$ $1/$2 [QSA,NC,NE,L]
RewriteRule ^list/([^/&?#]+)(.*)$ list.php?c=$1$2 [QSA,NC,NE,L]
RewriteRule ^xml/([^/&?#]+)(.*)$ xml.php?c=$1$2 [QSA,NC,NE,L]
RewriteRule ^search/([^/&?#]+)/(.*)$ plug.php?tab=$1&?e=search$2 [QSA,NC,NE,L]
RewriteRule ^tags/([^/&?#]+)/([^/&?#]+)/(.*)$ plug.php?a=$1&t=$2&e=tags$3 [QSA,NC,NE,L]
RewriteRule ^contactus(.*)$ plug.php?e=contactus$1 [QSA,NC,NE,L]
RewriteRule ^rss/([^/&?#]+)(.*)$ rss.php?c=$1$2 [QSA,NC,NE,L]
RewriteRule ^list/([^/&?#]+)/(.*)$ list.php?c=$1$2 [QSA,NC,NE,L]
RewriteRule ^([^/&?#]+)/([^/&?#]+)/(.*)$ page.php?c=$1&al=$2$3 [QSA,NC,NE,L]
RewriteRule ^([^/&?#]+)/([^/&?#]+)(.*)$ page.php?c=$1&al=$2$3 [QSA,NC,NE,L]
May the Source be with you!