Tuckey rewrite rule to servlet in /app doens't work
This issue only occurs in dotCMS 4.0.0 and higher, in dotCMS 3.x.x it works fine.
When I create a Tuckey rewrite rule for a servlet that is located under /app (for example /app/helloworld), the rewrite rule is not working.
But when I create another Tuckey rewrite rule for something outside /app, for example a file or image, the rewrite rule works.
I think there is a bug or something that prevents Tuckey rewrite rules to be applied to anything under /app.
I've created an example plugin which demonstrates this weird behavior. You can find this plugin here.
Expected Behavior
We should be able to create a Tuckey rewrite rule for a servlet that is located under /app.
Current Behavior
The rewrite rule created for a servlet located under /app doesn't forward to the servlet that is located under /app.
Possible Solution
It's working in dotCMS 3, but not in dotCMS 4.
Known Workarounds
None.
Steps to Reproduce (for bugs)
- Clone the example plugin that I've created
- Build the plugin with gradlew.jar bat (windows)
- Upload to your dotCMS instance
- Visit the page to check if the Hello World Servlet is registered - should be ok
http://demo.dotcms.com/app/helloworld
- Now try to visit the Hello World Servlet via the Tuckey rewrite rule, this won't work!
-
Rule created with addRewriteRule() method, doesn't work http://demo.dotcms.com/foo/bar/servlet-test
-
Rule created with NormalRule class, won't work either http://demo.dotcms.com/foo/bar/2servlet-test
- Now use Tuckey rewrite rule to forward to a file (image), this works...
http://demo.dotcms.com/foo/bar/image-forward
Context
We need this forward for our Minifier plugin to prevent extra requests for CSS/JS, you can find this plugin here (different branch for dotCMS 4.x.x)
Your Environment
- dotCMS version used: 4.1.1
- Browser Name: Chrome/FireFox/IE (doesn't matter)
- Operating System: Windows
- Java version: 1.8.0_131
- Database: MS SQL Server
This issue has been automatically marked as stale because it has not had activity within the past 90 days. It will be closed in 30 days no further activity occurs. Thank you.