Page 1 of 1

Making even nicer url to file download page?

PostPosted: Sun Nov 13, 2011 4:45 pm
by test
Well, .htaccess is making my urls look like: http://www.domain.com/123.filename - and that's ok.
BUT, what if I want to make http://www.domain.com/123 - to point to http://www.domain.com/123.filename? What should I write in the .htaccess file?

I want that http://www.domain.com/567 will point to http://www.domain.com/567.filename, or to download.php?file=567.filename (I prefer the second one ;))

Thanks for your help, and for this awesome script. :)

Re: Making even nicer url to file download page?

PostPosted: Mon Nov 14, 2011 6:11 am
by SamEA
How would .htaccess know where filename 567 is? Also, what if you had two files under the name 567? E.g. 567Filename1.jpg or 567Filename2.rar

Alternatively, you can change the way files are stored e.g. instead of 383Filename.rar, it will be 98291292?

Re: Making even nicer url to file download page?

PostPosted: Mon Nov 14, 2011 10:13 am
by test
Oh, I thought each file has a unique number... So never mind. :)
Unless, you can alter the code - to make every uploaded file check all of the IDs (unique file numbers) - and use a different (available) ID.
I know that the range is from 0 to 999 now, maybe that can be changed to 9999, or 99999 - basically - from 0 to a number so that people can upload unlimited amount files to a server, and there will be no collision with the IDs.

What do you think?

Re: Making even nicer url to file download page?

PostPosted: Wed Nov 16, 2011 7:07 am
by SamEA
Possible and I will try to MOD this one up for you soon, but not very soon due to the current workload I have. This MOD will also be beneficial for filenames with Arabic/Chinese/Russian or other languages containing symbols are uploaded.

Re: Making even nicer url to file download page?

PostPosted: Wed Nov 16, 2011 10:55 am
by test
Thanks alot! I appreciate it! :)