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

46 views
Skip to first unread message

Cedric Johnson

unread,
Sep 8, 2017, 1:41:21 PM9/8/17
to dotCMS User Group

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?

Chris Falzone

unread,
Sep 11, 2017, 1:38:59 PM9/11/17
to dotCMS User Group
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!

--
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 dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
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 all
Reply to author
Forward
Message has been deleted
0 new messages