News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

Howto : Get your pages downloads URL without SEF - Solution

Started by rikoooo, 21.05.2015 21:01:31

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rikoooo

Hi,

Migrating from jdownloads 1.9 to jdownloads 2.5 or 3.2 will cause to enable SEF URL by default in the component. Before in jdownloads 1.9 you could disable SEF URL in title, which was perfect !

If like me you wish to keep your URL style like before : http://www.exemple.com/downloads/viewdownload/54/480 then follow my little hack :

Open /components/com_jdownloads/router.php

IN THE IF STATEMENT : if ($view == 'download')
FIND LINE 123 $segments[] = $query['catid'];
REPLACE WITH $segments[] = (int)$query['catid'];

FIND LINE 139 : $segments[] = $query['id'];
REPLACE WITH : $segments[] = (int)$query['id'];

FIND LINE 108 : $segments[] = $view;
REPLACE WITH : $segments[] = 'viewdownload';

FIND LINE  383 : case 'download'
REPLACE WITH : case 'viewdownload'

That's it, now your URLs look like this : http://www.exemple.com/downloads/viewdownload/54/480

After migrating you also notified that your files id and categories id have changed like explained here http://www.jdownloads.com/forum/index.php?topic=8165.0  
I will also post a Howto which fix this problem with an SQL request that perfectly works !

Best regards,

Erik
  •