jDownloads Support Forum

Older Versions => jDownloads 3.2 (Support ended) => General => Topic started by: rikoooo on 21.05.2015 21:01:31

Title: Howto : Get your pages downloads URL without SEF - Solution
Post by: rikoooo on 21.05.2015 21:01:31
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