Re: [openupload-devel] Different URLs ?
Status: Beta
Brought to you by:
tsdogs
|
From: Harald N. <nik...@xe...> - 2010-10-25 21:31:55
|
Hi all, so here are the lines necessary to create a safer URL. containing just letters, digits and slashes: In lib/modules/default/files.inc.php, look for function setupLinks on line 260 Replace $finfo[0]['downloadlink']= app()->config['WWW_SERVER'].app()->config['WWW_ROOT'].'/?'.$a.'=d&'.$i.'='.$finfo[0]['id']; $finfo[0]['removelink']=app()->config['WWW_SERVER'].app()->config['WWW_ROOT']. '/?'.$a.'=r&'.$i.'='.$finfo[0]['id'].'&'.$r.'='.$finfo[0]['remove']; with: $finfo[0]['downloadlink']= app()->config['WWW_SERVER'].app()->config['WWW_ROOT'].'/d/'.$finfo[0]['id']; $finfo[0]['removelink']=app()->config['WWW_SERVER'].app()->config['WWW_ROOT'].'/r/'.$finfo[0]['id'].'/'.$finfo[0]['remove']; In .htaccess, enter: RewriteEngine on RewriteRule ^([a-z])/([a-zA-Z0-9]+)$ /openupload/?a=$1&i=$2 [R,L] RewriteRule ^([a-z])/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ /openupload/?a=$1&i=$2&r=$3 [R,L] This works for me. I hope I didn't miss anything. Cheers Hasrald On Fri, 22 Oct 2010, Alessandro Briosi wrote: > Hi Harald. > > Il 21/10/2010 23:23, Harald Nikolaus ha scritto: >> Hi again, >> ... >> >> Oh, right. So what would be easier? I guess not using mod_rewrite means >> more rewriting in the application, does it? >> > Yes, this needs some coding. > > The simplest would be to have a redirect, to the page with the & version > So intercept the actions you need and redirect according, but haven't > looked deep enough yet. > > I guess that right now best way is go the mod_rewrite rule (and change > the links returned by the file.inc.php to the user > > Alessandro > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > Openupload-devel mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openupload-devel > |