× Here you can get community support related to ReDJ.

Rewrite to redirect some links to old site

More
10 years 3 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.

More
10 years 3 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.

More
10 years 3 months ago #2018 by admin
Replied by admin on topic Rewrite to redirect some links to old site
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.

More
10 years 3 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.

More
10 years 3 months ago #2029 by admin
Replied by admin on topic Rewrite to redirect some links to old site
U're welcome! :)

Luigi

Please Log in or Create an account to join the conversation.

Time to create page: 0.188 seconds