'redirect' and 'proxy' vs 'forward' and 'passthrough' in Tuckey URLRewrite

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

'redirect' and 'proxy' vs 'forward' and 'passthrough' in Tuckey URLRewrite

Cedric Johnson

Note that, in my attempt to display code examples, I will redact/edit out any references to the company for whom I work in an effort to obscure their identity, not so much to hide the fact that I'm even asking. It should also be of note that I am very new to this game of UrlRewrite/Tuckey/dotCMS.



I have been having trouble getting a redirect to work. It's using Tuckey URLRewrite through dotCMS. The attempt is to redirect, but as a forward versus a proxy, for SEO purposes.


I've found that the following works ('redirect' and 'proxy' are interchangeable here):

<to type="proxy">http://[redacted]:8080$1$3?%{query-string}</to>



However, the following leads to a 404 ('forward' and 'passthrough' are interchangeable here):

<to type="forward">http://[redacted]:8080$1$3?%{query-string}</to>



The entirety of the rule is as follows:

 <!-- EN with Query Params -->
<rule>
<from>^/([^/]+)/en/([^/]+)?$</from>
<to type="proxy" qsappend="true">[redacted]:8080$1$3&amp;%{query-string}</to>
</rule>

<!-- EN without Query Params -->
<rule>
<from>^(.*)(\/en)(\/.*)?$</from>
<to type="proxy">[redacted]:8080$1$3?%{query-string}</to>
</rule>

Some of my initial questions (as many more are likely to arise):

  1. Is there such a difference between 'proxy'/'redirect' and 'forward'/'passthrough' that more specialized efforts to achieve a meaningful redirect need to be implemented?
  2. Am I missing something in other configuration files that may affect the outcomes of these attempts at redirection?

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/71dcc4d2-7582-48d6-bdae-b9a31848513a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: 'redirect' and 'proxy' vs 'forward' and 'passthrough' in Tuckey URLRewrite

Falzone, Chris
In certain cases forward rules are broken in dotCMS plugins.  There has been a lot of discussion on the group about it.  

It looks like the original issue in github was closed:  https://github.com/dotCMS/core/issues/9665
It looks like they plan to address the issue this way:  https://github.com/dotCMS/core/issues/12315
Which is basically not fixing the issue (grrrr), but providing the functionality to do the same thing with vanity urls.  

There is a work-around, I thought it was in the comments of the ticket but I don't see it. 
The idea there is that you put what you need in the session and then use the CMSFilter Override to do the forward for you.
It's a bit of a hack, but until the vanity urls solution is implemented it's the best they are going to give us.

Hope that helps!

On Fri, Sep 8, 2017 at 1:41 PM Cedric Johnson <[hidden email]> wrote:

Note that, in my attempt to display code examples, I will redact/edit out any references to the company for whom I work in an effort to obscure their identity, not so much to hide the fact that I'm even asking. It should also be of note that I am very new to this game of UrlRewrite/Tuckey/dotCMS.



I have been having trouble getting a redirect to work. It's using Tuckey URLRewrite through dotCMS. The attempt is to redirect, but as a forward versus a proxy, for SEO purposes.


I've found that the following works ('redirect' and 'proxy' are interchangeable here):

<to type="proxy">http://[redacted]:8080$1$3?%{query-string}</to>



However, the following leads to a 404 ('forward' and 'passthrough' are interchangeable here):

<to type="forward">http://[redacted]:8080$1$3?%{query-string}</to>



The entirety of the rule is as follows:

 <!-- EN with Query Params -->
<rule>
<from>^/([^/]+)/en/([^/]+)?$</from>
<to type="proxy" qsappend="true">[redacted]:8080$1$3&amp;%{query-string}</to>
</rule>

<!-- EN without Query Params -->
<rule>
<from>^(.*)(\/en)(\/.*)?$</from>
<to type="proxy">[redacted]:8080$1$3?%{query-string}</to>
</rule>

Some of my initial questions (as many more are likely to arise):

  1. Is there such a difference between 'proxy'/'redirect' and 'forward'/'passthrough' that more specialized efforts to achieve a meaningful redirect need to be implemented?
  2. Am I missing something in other configuration files that may affect the outcomes of these attempts at redirection?

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/71dcc4d2-7582-48d6-bdae-b9a31848513a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAMAbHgVPf0WQx0S5fa%2BCb8NOSpGuUVOwuiA0Ut1hYMz1hAVHfw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.