Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2020-12-08 02:35:45
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Redirect one download link to another
I am trying to redirect with .htaccess
one download link to another, but it doesn’t work.
Redirect 301 /file_download/1/title.pdf https://domain.tld/file_download/13/title.pdf
or…
RedirectMatch 301 /file_download/1/title.pdf /file_download/13/title.pdf
Does anyone have an idea why this isn’t redirected?
Offline
Re: Redirect one download link to another
I have it working with RedirectMatch 301
. What is happening on your side ?
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
#3 2020-12-09 03:34:45
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: Redirect one download link to another
It works with article or section URLs, but not with /file_download/.
Offline
Re: Redirect one download link to another
That is strange, it works perfectly here. Maybe try omitting the file-name.ext, like this:
Redirect 301 /file_download/1/title.pdf https://domain.tld/file_download/13/
Otherwise I have no clue.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Redirect one download link to another
Where do you have it in your .htaccess
file? As far as I remember it should be before Textpattern does any other handling of files, e.g. above the REQUEST_FILENAME and after the Rewrite Base, e.g. here.
TXP Builders – finely-crafted code, design and txp
Offline
#6 2020-12-09 17:22:24
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: Redirect one download link to another
I thought “that’s it, jakob always makes good suggestions”. But unfortunately that doesn’t work either.
Offline
Re: Redirect one download link to another
Is the direct access to the replacing file working at all?
Offline
#8 2020-12-10 01:52:39
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: Redirect one download link to another
Yes, there are two files with working, direct download. But I want file #1 not to be downloaded anymore, but file #11 in its place.
There are people who still have the old link for a file with date without knowing that there is a newer version of the file that has no date in the link, but is always up-to-date.
Offline
Re: Redirect one download link to another
It would have been much simpler to replace the file (similar to the way images are replaced), but I remember that this is an issue with txp for some years now. I’m not sure if it was fixed since OK, I eventually did see your post in the forum. .
Last edited by colak (2020-12-10 05:12:04)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Pages: 1