We are having an issue with redirects on tomcat using UrlRewriteFilter. Our goal is to have a vanity URL for our athletics website, while directing all incoming traffic looking for “/homepage/athletics.nsf” to our abbreviated domain www.spfldcol.edu. The two rules seem to conflict with each other, because the redirected URL ends up getting appended incorrectly. Any thoughts in terms of what we could do differently ?
Hi Brian,
Could you provide the syntax your using for the rule? You can paste the rules in a reply, just make sure you enclose them with these elements:
at this point we want all incoming traffic that has the string /homepage/athletics.nsf to go to www.spfldcol.edu/homepage/athletics.nsf/, as we will have spfldcol.edu pointing to a server that is not our cm1 tomcat server.
(all incoming traffic at our full url springfieldcollege.edu will be going to tomcat)
The first rule seems to be working as we are expecting, but when we include the rule for the vanity URL (it would like like www.springfieldcollege.edu/Athletics) the initial rule stops working, and we get an error.
Hi Brian,
I made of few tweaks to the syntax, adding starting and ending delimiters to /athletics in your second rule. Can you try this and let me know if this helps?
We have mapped out where old URLs have new URLs on CM1. We seem to have two rules that in conflict and are wondering if there is any way to have them both working.
We would like users or crawlers that have indexed a sample page found here:
/homepage/dept.nsf/BC81220B343BE6788525738E005FDA74/686EC96CBF7F0ABF85257A0E0068A400
redirect to here:
/giving-to-springfield-college/welcome-parents-families/faqs-for-parents/index
We have attempted to implement this rule:
<rule> <br> <from>^/homepage/dept.nsf/BC81220B343BE6788525738E005FDA74/686EC96CBF7F0ABF85257A0E0068A400$</from> <br> <to type="forward" last="true">/giving-to-springfield-college/welcome-parents-families/faqs-for-parents/index</to> <br> </rule>
But we also have a more general rule that should be handling pages for which we do not have new content on CM1, and this rule seems to be superseding the rule listed above:
<rule> <br>
<from>/homepage/dept.nsf/(.*)</from> <br>
<to type="redirect">http://mind2.spfldcol.edu/homepage/dept.nsf/$1</to> <br>
<set type="status">302</set> <br> </rule>
The placement and name of the URL rewrite filter XML file that you have described is not standard, but I assume your server admins made the required changes so that Tomcat will pick up this file once it has been approved and published. They can check the Tomcat log file, catalina.log, to quickly verify that your URL rewrite filter XML file is being picked up by the server.
One other reason this may not be working for you is because changes to this XML file will not be picked up by the server until you restart Tomcat. This could certainly explain why your rules are not working, if your server admins haven’t restarted Tomcat following the changes you’ve made to the file.
We have a problem with our site where it’s not resolving unless users enter WWW for our address. Does anyone know if this can this be handled with URL Rewrite Filter, or is there a preferred option for taking care of this?
Brian, yes, a server level redirect routing non-WWW to WWW URLs is a common and recommended approach. From accessing your site just now over the non-WWW URL, it appears that you might have already successfully setup such a redirect – is that correct?
An alternate approach would have been to setup your site’s main virtual host to listen for requests coming into the sever over both WWW and non-WWW. Because you are running a Tomcat front end web server, that addition would be made using the Alias element. In your Tomcat’s server.xml file, a virtual host using the Alias element would look like this: