views:

106

answers:

1

I have my app engine project myproject.appspot.com hosted at myprojectsdomain.com. I want to permanently redirect all links at myprojectsdomain.com to brandNewDomain.com. I found the Java URL Rewrite filter at http://code.google.com/p/urlrewritefilter/ , but I'm not seeing the documentation on how to use this for a 301 redirect for changing the domain. All the examples seem to be for rewriting the url within the same domain, which doesn't do me much good in my current situation. Am I looking in the wrong places or is there a better way for me to permenantly redirect my Google App Engine Java project? Thanks!

+1  A: 

Yes, you are looking at the wrong module. urlrewritefilter just changes the URL before your servlet gets to see it (but it still goes to that servlet). It does not do redirects.

You can implement this yourself, by mapping all URL to a single servlet, which just returns the redirect response (response.sendRedirect).

Thilo
I may have stated the question in a confusing manner. My site is now at la.truxmap.com and I want to do a permanent redirect to la.foodtrucksmap.com. That is, I want to same servlets to remain intact, I merely want to use the new domain for SEO purposes.
culov
Both domains on the same App Engine? In this case, add a Filter to look at what domain comes in and redirect if it is not the one you want, if it is the one you want, let the request continue. But you should probably have two different App Engines set up, one for each domain. The old one would just redirect to the new one.
Thilo
I've spent a while reading about filters and I know what I need to do, but im having trouble trying to figure out exactly where the filter should go. I'm using GWT and GAE Java, so I was thinking it should go before the servlet thats called upon page load, but thats simply the RPC servlet that extends RemoteServiceServlet.
culov