Rewrite to redirect some links to old site
-
sem
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 3
-
Thank you received: 0
-
-
11 years 2 months ago #2013
by sem
Hi - been tying myself up in knots at this.
I have a new site being built on the same domain as existing. All content has been imported fine. I use JoomlaTools docman for documents on both old and new site. I don't want to import all the old documents because there's a lot of junk - problem is, all the links to documents embedded in content pages are relative. I need to be able to selectively catch links to old documents and then redirect them to the old site.
I tried an apache rewrite rule but couldn't get it working - then found your plugin - which looks great but I must have been getting the syntax wrong.
Example is:
(relative link embedded in content) /documents/library-home/doc_download/3288_example_document.pdf needs to redirect to:
intranet.mydomain.local/documents/library-home/doc_download/3288_example_document.pdf
I need to catch any link that starts /documents/ and add on the old server name and domain but keep the url intact. Is this possible?
thanks, sem
Please Log in or Create an account to join the conversation.
-
sem
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 3
-
Thank you received: 0
-
-
11 years 2 months ago #2014
by sem
Solved it!
Created a rule thus:
From URL: /documents/
To URL: http://oldserver.domain.local{path}{queryfull}
Type 301, Case sensitive False, Request Only False, Decode URL True
Works a treat!
Thanks for a great plugin!
sem
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
11 years 2 months ago #2018
by admin
Hi Sem,
just a little suggestion to improve your rule:
From URL: ^/documents/
To URL: http://oldserver.domain.local{path}{queryfull}
Request only: true (checked)
In this way your rule matches only URL starting with /documents/ while your rule match ANY URL containing /documents/ everywhere. Hope this makes sense for you.
Kind regards,
Luigi
The following user(s) said Thank You: sem
Please Log in or Create an account to join the conversation.
-
sem
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 3
-
Thank you received: 0
-
-
11 years 2 months ago #2028
by sem
Ah! Yes, thanks Luigi! It's not a problem for my use though as all the links to documents are relative and were done using Advanced Docman Linker in JCE. Thank you for the suggestion.
sem
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
Time to create page: 0.126 seconds