davo Posted September 9, 2014 Posted September 9, 2014 In previous posts I've dealt with redirecting individual pages from an old site location to a new one. But this is slightly different. On the old non pw site there were a fair number of PDFs with a link to other PDFs all stored in a FTP share. I can't easily move all the files across because the links are hard coded into other PDFs. Long term I will move the files across and slowly change the PDFs. What I need to do is redirect any traffic to http://www.dudmc.com/newsletter/****** to the old site http://www.dudmc.co.uk/newsletter/******* This is an example http://www.dudmc.com/newsletter/Prague_Hotels.pdf Unless anyone can think of a better or different way I think the only answer could be is to use apache rewrite in the htaccess file..... But I'm fairly useless with that. Could anyone help please? This is only a short term solution.
mr-fan Posted September 9, 2014 Posted September 9, 2014 Soma handles documents with a special setup and a template so you could easy setup pdf's with a field "old-path" and check for this so the "old" links should work: here is his tutorial: https://processwire.com/talk/topic/4602-flexible-downloads-using-pages/ http://soma.urlich.ch/posts/flexible-downloads-using-pages/ this is really great! I use it on a page with some pdf's to count downloads - so your file could have a different name/url and adding an "old-url" field should be no problem. And since a pdf-download is a page you can redirect it via your normal methode, too without need of additional fields and changing the PDF!! Hope this helps - mr-fan 1
teppo Posted September 9, 2014 Posted September 9, 2014 This sort of thing is rather easy to set up using mod_rewrite too, and if there's a lot of content, that's often only sensible option. This thread might be of help to you, the problem is essentially the same. Note, though, that you should be careful with 301 redirects -- since in theory they're "permanent" browsers can cache them for a very long time. For temporary, short-term solution use 302's instead. 2
davo Posted September 9, 2014 Author Posted September 9, 2014 Soma handles documents with a special setup and a template so you could easy setup pdf's with a field "old-path" and check for this so the "old" links should work: here is his tutorial: https://processwire.com/talk/topic/4602-flexible-downloads-using-pages/ http://soma.urlich.ch/posts/flexible-downloads-using-pages/ this is really great! I use it on a page with some pdf's to count downloads - so your file could have a different name/url and adding an "old-url" field should be no problem. And since a pdf-download is a page you can redirect it via your normal methode, too without need of additional fields and changing the PDF!! Hope this helps - mr-fan Thank you MF; that does look good for future use but I don't think it will achieve what I'm trying to do today.
davo Posted September 9, 2014 Author Posted September 9, 2014 This sort of thing is rather easy to set up using mod_rewrite too, and if there's a lot of content, that's often only sensible option. This thread might be of help to you, the problem is essentially the same. Note, though, that you should be careful with 301 redirects -- since in theory they're "permanent" browsers can cache them for a very long time. For temporary, short-term solution use 302's instead. RESULT! Cheers This is only a temporary solution until all content from the old site have been migrated.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now