cotonti.com : Tags and url Rewrite Problem https://www.cotonti.com Последние сообщения в теме Cotonti en Thu, 18 Dec 2025 20:32:11 -0000 MUST! сб, 03 апр 2010 19:45:58 -0000 GHengeveld In the core (and plugins), all URLs should be created using sed_url(), since this allows for the automated rewriting with urltrans.dat. Absolute URLs may prevent this from working correctly with dynamic subdomains (since it prepends the base domain as set in the configuration panel, which usually contains www as subdomain).]]> сб, 27 мар 2010 23:07:20 -0000 donP ]]> сб, 27 мар 2010 15:58:43 -0000 GHengeveld сб, 27 мар 2010 07:44:07 -0000 donP
header("Location: " . SED_ABSOLUTE_URL . $r_url);
with
header("Location: " . $r_url);
in page.add.inc.php
and oher similiar lines in page.edit.inc.php 'cause using rewriting like me (to create fake third level domains with main category code of page structure) is incompatible with SED_ABSOLUTE_URL...

In those locations we must consider to force the core to control if the actual rewritten url (by sed_url() + functions.custom) it's a compatible-old one or it already contains http:// or a third level domain format...]]>
пт, 26 мар 2010 18:48:36 -0000
GHengeveld
What you should do is:
- Open datas/urltrans.dat and add this line at the top
page	*	{page_url_structure()}
- Open/create system/functions.custom.php and add this:
function page_url_structure(&$args, &$spec)
{
    global $sed_cat, $pag, $row, $rpagecat;
 
    $page_cat = (!empty($sed_cat[$rpagecat]['path']) && empty($page_cat)) ? $sed_cat[$rpagecat]['path'] : $page_cat;
    $page_cat = (!empty($sed_cat[$pag['page_cat']]['path']) && empty($page_cat)) ? $sed_cat[$pag['page_cat']]['path'] : $page_cat;
    $page_cat = (!empty($sed_cat[$row['page_cat']]['path']) && empty($page_cat)) ? $sed_cat[$row['page_cat']]['path'] : $page_cat;
    $url =  str_replace('.', '/', $page_cat).'/';    
    if($args['id'])
    {
        $url .= $args['id'];
        unset($args['id']);
    }
    else
    {
        $url .= urlencode($args['al']);
        unset($args['al']);
    }
    return $url;
}
- Then open .htaccess and add this:
RewriteEngine On
#for page id
RewriteRule ^(articles|news)/([a-z-]+)/([a-z-]+)/([a0-9]+)$ page.php?id=$4 [QSA,NC,NE,L]
RewriteRule ^(articles|news)/([a-z-]+)/([0-9]+)$ page.php?id=$3 [QSA,NC,NE,L]
RewriteRule ^(articles|news)/([0-9]+)$ page.php?id=$2 [QSA,NC,NE,L]

#for page alias
RewriteRule ^(articles|news)/([a-z-]+)/([a-z-]+)/([a-zA-Z0-9-_]+)$ page.php?al=$4 [QSA,NC,NE,L]
RewriteRule ^(articles|news)/([a-z-]+)/([a-zA-Z0-9-_]+)$ page.php?al=$3 [QSA,NC,NE,L]
RewriteRule ^(articles|news)/([a-zA-Z0-9-_]+)$ page.php?al=$2 [QSA,NC,NE,L]
]]>
пт, 26 мар 2010 06:19:40 -0000
scriptor example:
Area: Page
Parameters: al=*
Format: {$c}/{$al}.html

Added 1 day later:

I solve the problem in the tag plugin file functions.php line 145 i change this

From: 'TAGS_RESULT_ROW_URL' => empty($row['page_alias']) ? sed_url('page', 'id='.$row['page_id']) : sed_url('page', 'al='.$row['page_alias']),
TO: 'TAGS_RESULT_ROW_URL' => $row['page_alias'] ? $row['page_cat'].'/'.$row['page_alias'].'.html' : sed_url('page', 'al='.$row['page_alias']),]]>
ср, 24 мар 2010 05:12:30 -0000
Trustmaster ср, 24 мар 2010 05:05:25 -0000 scriptor For Example:
tags show this
yoursite.com/artikel.html

and it would be that
yoursite.com/category/artikel.html

Anyone an idea how to fix it?]]>
ср, 24 мар 2010 04:55:05 -0000