如何处理自动/编码重定向?

hope all active user on this community are fine..

I m facing a problem and for that I was looking for help..:)

I have a software website and I update those software frequently.

so, for example.. a software name is "example" and version is "1.0". later I have updated to version 1.1 and removed 1.0 from server. but say before I updated it to 1.1 many user have 1.0 link to download

ex:

www.example.com/downloads/example.V1.0.exe

so, as that file is not available anymore so, my user will get confused.

so, I want to redirect all that link to current version

so, I did this: I go to c-panel, the redirect page, then direct that particular exe to current exe file.

but the problem is I have many products and also make updates version for those .. so, it will be very hard to always updated that through c-panel redirects :( and in some case it would be so tough.

for example after some time I have released 50 versions..

like: 1.1,1.2,1.3 .... 9.55

and many user could have any version link, so it will be impossible to use c-panel redirects to all those old version to current version..

so, what I want.. a easier way to redirect those non exiting file to latest file

any suggestion would be highly appreciated

I have this idea:

  1. I will use my own 404.php for 404 error
  2. I will code that 404.php in a way that it will check the referrer url ( I am not sure is that call referrer or what)
  3. I will use csv/text file, my php code will check if the referrer url is in csv/text file, if so, then it will redirect to new file that is in my csv/text file too. and if not then it will redirect to my regular 404.html file or to home page.

is it a good idea?

if so, then I just need a help to get the referrer url. for example which url call my 404.php..

I hope I m clear and I have explained in it detail..

so, I would expect an help ASAP

thanks in advance for any upcoming help best regards

The best thing you could do is have a link called 'latest', which would redirect to your latest version of your executable.

For example, say I have three releases: v0.0.1 (initial release, not for production), v1.0.0 (production release), and v1.2.0 (hotfix for v1.0.0, production ready). In my website, I would have it laid out like this:

www.example.com/downloads/releases/example_latest.exe

This would redirect to:

www.example.com/downloads/releases/example_v1_2_0.exe

And then I would have a link to the FTP site holding all of the public releases, which would contain v1.2.0 and v1.0.0:

www.example.com/downloads/releases/

and I would have nightly builds hiding at some internal URL that is not available to the public, like www.example.com/downloads/nightly/

Hope this helps!