0

Referring to previous question

What is an elegant way to force browsers to reload cached CSS/JS files?

I have changed the file name based on last modified timestamps. i.e. from "scripts/main.js" to "scripts/main.1221534296.js"

I am using WebSphere Application Server 6.1. Is there any way to define URL rewrite rule in it to get real file name from generated file name when a request to load such resource is received?

Community
  • 1
  • 1
Bilal Mirza
  • 2,576
  • 4
  • 30
  • 57

1 Answers1

1

We do all our rewrite rules in the fronting web server (in our case, IBM HTTP Server). See these articles for how to do that:

Note particularly the [PT] flag.

I don't know of any way to create rewrite rules within WebSphere itself. You may require a web filter like https://github.com/paultuckey/urlrewritefilter/

dbreaux
  • 4,982
  • 1
  • 25
  • 64
  • thanks. Your solution is to bring a proxy server in place. And we can't do this thing. I am unable to find a way to do this little thing in websphere, and I was not expecting this. – Bilal Mirza Jun 06 '12 at 05:49
  • I'm not talking about a proxy server, but a web server. It's not normally recommended for WebSphere Application Server to directly serve content, but to be fronted by a web server and/or a proxy server. If you're unable to do this, I don't have an answer for you. Like I said, I don't think WAS can do URL rewriting by itself. You may require a web filter like http://code.google.com/p/urlrewritefilter/ – dbreaux Jun 06 '12 at 13:48
  • Thank you. I was thinking to create a filter myself but you save hours of me. This is really great thing. As this filter solved my problem. I am marking your reply as accepted answer. – Bilal Mirza Jun 08 '12 at 03:42