S
S
Sergey Sergeev2018-11-01 20:14:01
htaccess
Sergey Sergeev, 2018-11-01 20:14:01

Category title instead of id in url?

Hello everyone, I ask you to help me deal with this task, now the link to the category looks like SITE.COM/TEMA/2 where 2 is the category id
so that instead of numbers there is a category title like this - SITE.COM/TEMA/POLITIKA
Link in functions

'/^index\.php\?link1=tema&id=([^\/]+)$/i',
                        $config['site_url'] . '/tema/$1',

htaccess
RewriteRule ^tema/(\d+)(/?|)$ index.php?link1=tema&id=$1 [NC,QSA]

post data
$fetched_data['category_link'] = Wo_SeoLink('index.php?link1=tema&id=' . $fetched_data['сategory']);

The link itself looks like this
<a href="<?php echo Wo_SeoLink('index.php?link1=tema&id=' . $key) ?>" data-ajax="?link1=tema&id=<?php echo $key?>"><?php echo $category;?></a>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question